Multiple Functions

pwoodj

Registered User.
Local time
Today, 06:41
Joined
Mar 9, 2005
Messages
19
I have a query that contains a field with 4 codes that I need to replace with values.

Example:
Replace([CE020]![LNCH_FLG],"0","None") Replace([CE020]![LNCH_FLG],"1","Free") Replace([CE020]![LNCH_FLG],"2","Reduced")
Replace([CE020]![LNCH_FLG],"3","State Free")
Replace([CE020]![LNCH_FLG],"4"," Paid")


I get an invalid syntax error, I know if I was to have one Replace function it will works fine, but I’ll still have 3 code to convert.

Any Ideas?

Thanks
--pete
 
Is 0,1,2,3 & 4 the only value in LNCH_FLG or are these part of a bigger string?
 
Yes, just the 5 numbers.
 
Then I would simply make these constants and call them with a function or put them in a seperate table and link 'em when needed...
 
It seems to slow it down a little, but it works, thanks again..
 
You may want to index something and see if that helps...
 
Hi-

If you're going from "0" to "None", etc., the following update query should get it:
Code:
UPDATE CEO20 SET CEO20.lnch_flg = Choose(Val([lnch_flg])+1,"None","Free","Reduced","State Free","Paid");

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom