Date/Time & Sql conversion issues

K

katmagic

I am having a heck of a time figuring out how to format a datetime value to
what sql wants. I have even copied the exception error and created a value
of Dim myDate as datetime="#1/1/1753 12:01:00 AM#" I've tried it with both
the # and without, I have tried using a string value and a datetime value.
I continue to get the error SqlDateTime overflow. Must be between 1/1/1753
12:00:00 AM and 12/31/9999 11:59:59 PM."

Do I have to make the value in my stored procedure a varchar and also the
field in the table a varchar? Is there no way to make a datetime field in
vb work with sql?

thank you for your help.
 
G

Gregory A. Beamer

With SQL Server, use the DateTime in the SQL objects. You should also be
able to use a .NET DateTime, although you might have to use .ToString() to
feed to the parameter correctly.

I have not had problems with strings, as far as I remember, but the ## have
to go. That is an "Access-ism".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top