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

SQL problem

Status
Not open for further replies.

capone67

Programmer
Nov 6, 2000
115
CA

Hi Gang

I am trying to execute an SQL query that has a date in it. I am getting a data type mismatch error using the following code. How do I represent a date in a format that SQL will recognize?

Here is my code.

SELECT count(*)
FROM Schedule
WHERE Hour='0' And MyDate='11/15/2000';


TIA

Ken
 
Try using
SELECT count(*)
FROM Schedule
WHERE Hour='0' And MyDate='#11/15/2000#';


or else

SELECT count(*)
FROM Schedule
WHERE Hour='0' And MyDate=#11/15/2000#;
 
Thanks

This one worked

SELECT count(*)
FROM Schedule
WHERE Hour='0' And MyDate=#11/15/2000#;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top