SeadnaS
Programmer
- May 30, 2011
- 214
Hi,
I have transferred some tables to a my SQL Server 2008 backend and need to modify some queries. I was told to use a pass through query so im trying to convert the Jet SQL to T SQL but I don't know what to do with these iif statements.
EXP_D:
IIf(IsNull([EXP_DATE2]),"",IIf([EXP_DATE2]="","",Trim([EXP_DATE2])))
and
MM: IIf([EXP_D]="",Format(Now(),"yyyy/mm"),IIf(IsNull([EXP_D]),Format(Now(),"yyyy/mm"),Format([EXP_D],"yyyy/mm")))
I am aware that I need to use CASE but i really don't know how to apply it to these iif statements.
Any help much appreciated!
Seadna.
I have transferred some tables to a my SQL Server 2008 backend and need to modify some queries. I was told to use a pass through query so im trying to convert the Jet SQL to T SQL but I don't know what to do with these iif statements.
EXP_D:
IIf(IsNull([EXP_DATE2]),"",IIf([EXP_DATE2]="","",Trim([EXP_DATE2])))
and
MM: IIf([EXP_D]="",Format(Now(),"yyyy/mm"),IIf(IsNull([EXP_D]),Format(Now(),"yyyy/mm"),Format([EXP_D],"yyyy/mm")))
I am aware that I need to use CASE but i really don't know how to apply it to these iif statements.
Any help much appreciated!
Seadna.