views:

71

answers:

2
Select col1 FROM mytable WHERE ValidUntil > 7/9/2009 8:45:30 pm

and the error is Incorrect syntax near '8'.

So what is wrong with this sql statement?

I tried this directly on SQL management studio...

+3  A: 
Select col1 FROM mytable WHERE ValidUntil > '7/9/2009 8:45:30 pm'

Be aware that it all depend on the collation of your column. If the collation is latin french, for example, the 'pm' will not work.

Pierre-Alain Vigeant
Yeap! I have Grrek collation
Chocol8
A: 

I'm not very sure but 'yyyy-MM-dd hh:mm-dd' format is working with all collations. Try not to use am / pm. It is better to use 24-hour format.

Eren