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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2009-10-20 : 08:55:51
|
| I am so confused IIF in VBA. For example, I need to conver the following VBA to T-SQL, can someone help me?WHERE (((CLAIMNO) Like Year(Date()) & IIf (Month(Date())<10, "0" & Month(Date()), Month(Date())) & IIf (Day(Date())<10, "0" & Day(Date()), Day(Date())) & IIf ([Operator]<10, "00" & [Operator], IIf([Operator]<100, "0" & [Operator], [Operator])) & "*")) |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2009-10-20 : 09:30:58
|
| IFF => CASEhave a go at some simple constructs in SQL and try to transpose any lessons learnt to working this code out. come back to the forum if really stuck. |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-10-20 : 09:55:03
|
| I believe a lot of your code can be solved with thisselect convert(varchar(10),date,112)+ right('00'+operator',3)JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|