Query Expression

M

Michael

Hi Folks - I have a query that lists all 50 states. I would like to create a
calculated field that assigns a region to the state. So, RI, MA, CT, VT, ME
and NH would be assigned New England, and CA, OR and WS would be assigned
West Coast, etc. What's the best way to accomplish this? Thanks.

Michael
 
E

E

youd need some way to correlate the states with the regions.
like a table.
in that case, you can group by the regions.
your table would like something like this:

State, Region
 
J

Jeff L

Create a table that has the state as the Primary Key and region in it,
join it to your query on the state, and select the region in your
output. Trying to do a calculated field in this case would be really
cumbersome.

FYI....Washington is WA, not WS.

Hope that helps!
 
B

betwalk

--------------------------
You could use the SWITCH function to create an expression in your query
which would read the state and show the proper region on for each
record.

hth-

Betsy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top