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...
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...
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.
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.