What function in Access can be used like Decode in Sql?

absolut

New Member
Joined
May 11, 2004
Messages
16
Below is a sql string I am attempting to use in a query design. How would I convert this and where would I put it to achieve the munipulated data label for the contents of the field?

decode(assets.owning_center_code,'01','CORP (01,13)','02','CAASD (02)','03','CAFC2S (03,51)','05','CIIS (05)','07','C3 (07)','13','CORP (01,13)','19','CEM (19)','48','DOD (48)','51','CAFC2S (03,51)','Unknown'),

assets is the table
owning_center_code is the field

01
02
03
05
07
13
19
48
51 are the values in the column
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Do you mean you've cleared it up yourself?

If you have you could maybe post how you did it.

I've seen this question a couple of times and have suggested using the Switch statement or just using a query.

It would be interesting to know how you solved it.
 
Upvote 0
I build a very small link table with the above data in it. 2 Columns

Then did a match in my query and used the new value column as the display. I named the 2nd column with the new data in it the same name as the original column in the first data set so the other merges and queries and reports would be the same but would have the new data values in them.

Hope that made sense.
 
Upvote 0

Forum statistics

Threads
1,221,893
Messages
6,162,662
Members
451,781
Latest member
DylantheD

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top