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

Correct syntax for datetime

Status
Not open for further replies.

Ogi

Technical User
Nov 9, 2001
896
0
0
GB
Hi,

Can anyone help with the following SQL command:-

Select * From [TimeSheet Records] Where [Record Identity] = 27/12/2001 12:00:30

I've got a datetime field that contains the above data but can't get it!

I'm using VB and SQL 2000 Personal, if that helps!

Cheers,
Ogi.
 
Select * From [TimeSheet Records] Where [Record Identity] = '2001-12-27 12:00:30'
 
Hi Ogi,
Try DateValue function. It works in MS SQL Jet run agains MS Access Database. Like this:
Select * From [TimeSheet Records] Where [Record Identity] = DateValue('2001-12-27 12:00:30')
 
Hi,

Thanks, will try that now!

Regards,
Ogi.
 
Hi,

Well Fluteplr, 10 out of 10....worked first time, just need to reformat my date now!!!!

Cheers guys,
Ogi.

PS Not dismissing yours needsOLTPadvice :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top