GPSPOW
asked on
MAX and IIF statements Access vs SQL
I have an Access query with the following clause:
Max(IIf([dbo_AbsDrgDiagnos es]![Diagn osisSeqID] =1,[dbo_Ab sDrgDiagno ses]![Diag nosis],0)) AS PrinDiag
I have translated it to SQL as:
MAX(iif(dbo.AbsDrgDiagnose s.Diagnosi sSeqID=1,d bo.AbsDrgD iagnoses.D iagnosis,0 )) as PrinDiag
I am getting a syntax error that "error in list of function arguaments: "=" not recognized
Do you see what could be wrong?
Thanks
Glen
Max(IIf([dbo_AbsDrgDiagnos
I have translated it to SQL as:
MAX(iif(dbo.AbsDrgDiagnose
I am getting a syntax error that "error in list of function arguaments: "=" not recognized
Do you see what could be wrong?
Thanks
Glen
ASKER
Thanks I forgot about the case statement
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT (CASE WHEN dbo.AbsDrgDiagnoses.Diagno