Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Xorbit
Starting Member
3 Posts |
Posted - 2009-01-03 : 15:10:04
|
| Hi,I want a select statement to return true/false on whether a date is before or after another giveen date.I have tried with:SELECT(tablename.createdate > '2008-12-10') as beforeAfterFROM Tablename...But I get the error:Incorrect syntax near '>'.Is there a workaround to this that anybody know about? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-03 : 15:11:23
|
SELECT CASE WHEN CreateDate > '2008-12-10' THEN 'true' ELSE 'false' END AS BeforeAfterFROM TableName E 12°55'05.63"N 56°04'39.26" |
 |
|
|
Xorbit
Starting Member
3 Posts |
Posted - 2009-01-03 : 15:33:32
|
| Thanks a lot, works like a charm :-) |
 |
|
|
|
|
|