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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statement with date/time problem

Status
Not open for further replies.

jakeisstoked

Technical User
May 9, 2003
28
AU
Hi,
This probably has a simple answer but I've never doe it before so I'm stuck.

Heres my SQL statement

&quot;SELECT * FROM tblExample WHERE pDate >'01/01/01' AND pDateSubmitted <'10/05/10'&quot;

Using this statement gets a data type mismath error.

And

&quot;SELECT * FROM tblExample WHERE pDate >01/01/01 AND pDateSubmitted <10/05/10&quot;

Never returns any records, it's a date/time field in the database, I've tried a lot of combinations and I've got no idea.

Any help would be great.

Jake

 
Yes, Access. By the way, both pDateSubmitted should be pDate, thats a typo, not a problem in my SQL.
 
Ah then if you are using OLEDB connection you should use this way
&quot;SELECT * FROM tblExample WHERE pDate BETWEEN #01/01/01# AND #10/05/10#&quot;




________
George, M
 
Thanks alot, solved my problem! Is it only date/time that has to be ecnased inside 3's?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top