L
laura reid
Hello,
I'm trying write an update query that evaluates 3 critiera. I want it to
evaluate the critieria in one field [PP] and then update the values in the
[CIV TYP] field. My logic is as follows
If the PP Field is like C*, K* D*, or A*, then I want the CIV TYP field to
fill with 202.
If the PP Field is like X*, then fill CIV TYP field with 110
If the PP Field is like B*, then fill CIV TYP field with 206
for all else leave as is.
So this is what i've come up with from researching the newsgroups, but it
receive a syntax error.
UPDATE [CURRENT DCPDS]
SET [CURRENT DCPDS].[CIV TYP] = IIF(([CURRENT DCPDS].PP) Like "C*" Or
([CURRENT DCPDS].PP) Like "K*" Or ([CURRENT DCPDS].PP) Like "D*" Or ([CURRENT
DCPDS].PP) Like "A*"),"202")
SET [CURRENT DCPDS].[CIV TYP] = IIF(([CURRENT DCPDS].PP) Like "X*", "110")
SET [CURRENT DCPDS].[CIV TYP] = IIF(([CURRENT DCPDS].PP) Like "B*" ,"206")
I'm trying write an update query that evaluates 3 critiera. I want it to
evaluate the critieria in one field [PP] and then update the values in the
[CIV TYP] field. My logic is as follows
If the PP Field is like C*, K* D*, or A*, then I want the CIV TYP field to
fill with 202.
If the PP Field is like X*, then fill CIV TYP field with 110
If the PP Field is like B*, then fill CIV TYP field with 206
for all else leave as is.
So this is what i've come up with from researching the newsgroups, but it
receive a syntax error.
UPDATE [CURRENT DCPDS]
SET [CURRENT DCPDS].[CIV TYP] = IIF(([CURRENT DCPDS].PP) Like "C*" Or
([CURRENT DCPDS].PP) Like "K*" Or ([CURRENT DCPDS].PP) Like "D*" Or ([CURRENT
DCPDS].PP) Like "A*"),"202")
SET [CURRENT DCPDS].[CIV TYP] = IIF(([CURRENT DCPDS].PP) Like "X*", "110")
SET [CURRENT DCPDS].[CIV TYP] = IIF(([CURRENT DCPDS].PP) Like "B*" ,"206")