Convert data (text)

P

pointe

I would like to create a query that transforms a specific dataset from the
original excel table into a new column of data. The orginal data must remain
in that format, but I need to have the data appear differently.

For example, I have a column in excel that says "First Session Only" and I'd
like to have a column in my access database that recognizes this data and
transforms it to S1. There are only 3 phrases in the excel spreadsheet (First
Session Only, Second Session Only, and 10-week Session), so is there a
formula/expression that I can use in the query to convert this information
(to S1, S2, S10, for example)?

let me know if I need to clarify
 
K

KARL DEWEY

A couple of ways to do it. The simplest way is to use nested IIF statements.
Translated_Data: IIF([YourField]="First Session Only", "S1",
IIF([YourField]="Second Session Only", "S2", "S10"))
Another way would be to use a translation table that has field for old and
new joined in your query. This method is best for when you may have 20-30
varriations.
 

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