I am in the process of converting an msaccess application to SQL Server and I am having trouble converting this code to a case statement
IIf(([LOTOSMIS_RET_DAILY]![GM_CD]=6150 Or [LOTOSMIS_RET_DAILY]![GM_CD]>=12100),IIf(IsNull([GameXrefVar]![DCLBGame]),[LOTOSMIS_RET_DAILY]![GM_VAR],[GameXrefVar]![DCLBGame]),IIf(IsNull([GameXref]![DCLBGame]),[LOTOSMIS_RET_DAILY]![GM_CD],[GameXref]![DCLBGame])) AS GameID
i have tried
(CASE WHEN (P.GM_CD = 6150 OR P.GM_CD >= 12100) AND GameXrefVar.DCLBGame IS null
THEN P.GM_VAR = GameXrefVar.DCLBGame)
WHEN (P.GM_CD = 6150 Or P.GM_CD >= 12100) THEN (P.GM_VAR = GameXrefVar.DCLBGame
END) AS GameID
What am I doing wrong?
Thanks in advance
IIf(([LOTOSMIS_RET_DAILY]![GM_CD]=6150 Or [LOTOSMIS_RET_DAILY]![GM_CD]>=12100),IIf(IsNull([GameXrefVar]![DCLBGame]),[LOTOSMIS_RET_DAILY]![GM_VAR],[GameXrefVar]![DCLBGame]),IIf(IsNull([GameXref]![DCLBGame]),[LOTOSMIS_RET_DAILY]![GM_CD],[GameXref]![DCLBGame])) AS GameID
i have tried
(CASE WHEN (P.GM_CD = 6150 OR P.GM_CD >= 12100) AND GameXrefVar.DCLBGame IS null
THEN P.GM_VAR = GameXrefVar.DCLBGame)
WHEN (P.GM_CD = 6150 Or P.GM_CD >= 12100) THEN (P.GM_VAR = GameXrefVar.DCLBGame
END) AS GameID
What am I doing wrong?
Thanks in advance