I am trying to convert this query to slq server 2000 and I cant figure
out how to get rid of the IIF statements and make them case statements.
If anyone could help I would greatly appreciate it!
Thanks!
spafa
SELECT Jeopardy.Main, Jeopardy.Name, Jeopardy.COMMEN TS2,
Jeopardy.STATUS , Jeopardy.DENTAL _STATUS, Jeopardy.HLTH_I NC,
Jeopardy.DNTL_I NC, Jeopardy.COMP_H LTH, Jeopardy.COMP_H LTH_DISC,
Jeopardy.COMP_P LAN_DESIGN, Jeopardy.COMP_D NTL, Jeopardy.COMP_D NTL_DISC,
Jeopardy.OUT_TO _BID, IIf([COMP_HLTH]=\"Mass Blue
Cross\",\"YES\" ,IIf([COMP_HLTH]=\"Out of State Blue
Cross\",\"YES\" ,IIf([COMP_HLTH]=\"CT Blue
Cross\",\"YES\" ,IIf([COMP_HLTH]=\"Empire Blue Cross\",\"YES\" ,\"NO\"))))
AS OTHER_BC_PLAN, IIf([other_bc_plan]=\"yes\",[COMP_HLTH],\"\") AS
BC_PLAN, Jeopardy.LG_RAN KING, Jeopardy.LG_SCO RE, Jeopardy.DATE_N OTIFIED,
Jeopardy.DATE_U PDATED, Now()-([Jeopardy]![DATE_UPDATED]) AS DATEDIFF,
Now()-([Jeopardy]![DATE_ADDED]) AS DATEDIFF2,
IIf([DateDiff]<8,\"*\",Null ) AS CHANGE, IIf([DateDiff2]<8,\"+\",Null ) AS
[ADD], Jeopardy.Rep_Id , Jeopardy.Rep_Na me, tblIRIP_QA_NAME S.ADMIN_NAME
AS MSS, AccountOwnershi p.ANALYST_NAME, AccountOwnershi p.UND_NAME,
AccountOwnershi p.DNTL_UND_NAME , AccountOwnershi p.SERVICE_REP,
AccountOwnershi p.SIZE, AccountOwnershi p.SIZE2, Jeopardy.CYCLE,
Jeopardy.DENTAL _CYCLE, IIf([Jeopardy]![cycle] Is Null,[Jeopardy]![DENTA-
L_CYCLE],IIf([Jeopardy]![cycle]=\"N/A\",[Jeopardy]![DENTAL_CYCLE],[Jeop-
ardy]![cycle])) AS CYCLE2, AccountOwnershi p.Canc_Date,
AccountOwnershi p.Dntl_Canc_Dat e, AccountOwnershi p.EFFDATE,
AccountOwnershi p.Dntl_EFFDATE, AccountOwnershi p.TOTALHLTH,
AccountOwnershi p.TOTALDNTL, [healthmate]+[classic] AS TotalCross,
AccountOwnershi p.HEALTHMATE, AccountOwnershi p.CHIP,
AccountOwnershi p.CLASSIC, AccountOwnershi p.BROKER,
AccountOwnershi p.HLTH_BROKER_1 , AccountOwnershi p_DSC.DISPOSITI ON,
AccountOwnershi p_DSC.DISPOSITI ON_MONTH, IIf([DISPOSITION_mon th] Is Not
Null,\"YES\",\" NO\") AS OC, IIf([DISPOSITION_mon th] Is Not
Null,[DISPOSITION_mon th],Null) AS OC_MONTH
FROM ((AccountOwners hip_DSC RIGHT JOIN AccountOwnershi p ON
AccountOwnershi p_DSC.Main = AccountOwnershi p.Main) RIGHT JOIN Jeopardy
ON AccountOwnershi p.Main = Jeopardy.Main) LEFT JOIN tblIRIP_QA_NAME S ON
AccountOwnershi p.REP_ID = tblIRIP_QA_NAME S.Rep_Id ORDER BY
Jeopardy.DATE_U PDATED DESC; " );
--
Posted via http://dbforums.com
Comment