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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-05-07 : 11:30:24
|
| Jagjit writes "select iif(datediff(day,'02-may-2004',getdate()) > 1 ,1,0) as diffThe above statement gives me error Error Description:(Server: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near '>'.)Please explain how to rectify this error." |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-05-07 : 11:33:38
|
| trycase when datediff(day,'02-may-2004',getdate()) > 1 then 1else 0end as diffmight work :))Go with the flow & have fun! Else fight the flow :) |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-05-07 : 12:47:25
|
| IIF is an access (or excel) function not supported in SQL Server. CASE will work for you. You can find information and examples in Books Online.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|