A
Azzna
I am trying to do a conditional update in access using a case
statement. I have done this in Oracle, and I know it works, but I
can't get it to work in Access. When I run the statement it tells me I
have a syntax error (Missing Operator) in my query. I would appreciate
any help as I have been beating my head against this for about two
hours now and I can't seem to see the problem.
Here is my code:
update Import
Set Import.ArtGrp = Case( when Desc15 < 201
Then ArtGrp = Desc15
When Desc15 < 1000
Then ArtGrp = Right( Desc15,2)
When Desc15 >9999
Then ArtGrp = Right( Desc15,3))
END
WHERE Desc15 IS NOT NULL;
I keep finding conflicting information via searches on the web as to if
I can even do a case statement in an update in access. If I can't, is
there another way to do this short of creating three seperate queries?
Thank you!
statement. I have done this in Oracle, and I know it works, but I
can't get it to work in Access. When I run the statement it tells me I
have a syntax error (Missing Operator) in my query. I would appreciate
any help as I have been beating my head against this for about two
hours now and I can't seem to see the problem.
Here is my code:
update Import
Set Import.ArtGrp = Case( when Desc15 < 201
Then ArtGrp = Desc15
When Desc15 < 1000
Then ArtGrp = Right( Desc15,2)
When Desc15 >9999
Then ArtGrp = Right( Desc15,3))
END
WHERE Desc15 IS NOT NULL;
I keep finding conflicting information via searches on the web as to if
I can even do a case statement in an update in access. If I can't, is
there another way to do this short of creating three seperate queries?
Thank you!