Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a column in Date/Time type 1

Status
Not open for further replies.

Bitaoo

Programmer
Dec 18, 2002
81
US
Hello,

I have a problem that makes me crazy!!! I have a table
with two columns Id as AutoNumber and the othre is
birthDate as Date/Time, there is one record in this
table (1, 1/1/2001)
In VB6 I run this Select statement:

Select * from myTable Where birthData = 1/1/2001

It doesn't return any record (EOF = True)
I tried to run:

Select * from myTable Where birthData = "1/1/2001"

But I got an error "Data type mismatch in criteria expression"
Does any body know what is the problem? Thanks for your help.

--Bita
 
Try using #1/1/2001# instead of "1/1/2001".
 
Just a small tip, I found when using dates in SQL you must format the date as American... i.e mm/dd/yy

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top