Wednesday, March 7, 2012

DateTime again - how to us the time aswell as date

Hi All,

I have a SQl Statemnent ... AND dbStartDateTime >= 27/12/2003 19:00:00 ... and get the following error

Incorrect syntax near '19'

I dont understand why it wouldnt like this as this is how it is stored in the database?

I have looked for answers but most people seem to want ot use DateTime without the time

Thanks in advance

LeeYou should enclose the datetime value in single quotes.

 AND dbStartDateTime >= '27/12/2003 19:00:00'

Terri|||Thanks for your help Terri,

I need to re-read the chapter in my book! about syntax etc

Lee

No comments:

Post a Comment