How to set up this SQL ???

G

Guest

I have a column called Selection which can contain the values 1-3 which
represent Yes, No, N/A respectively.
In a report I must print the total for Yes, No and N/a and print totals and
percentages.
So I would like the query to create 3 columns from the Selection field, one
each for the values 1, 2 or 3. In each case the new column must be 1 if the
value meets the criteria or 0 if not (since I will be totalling in the
report). How can this be done? Any SQL gurus out there?
 
M

Marshall Barton

mscertified said:
I have a column called Selection which can contain the values 1-3 which
represent Yes, No, N/A respectively.
In a report I must print the total for Yes, No and N/a and print totals and
percentages.
So I would like the query to create 3 columns from the Selection field, one
each for the values 1, 2 or 3. In each case the new column must be 1 if the
value meets the criteria or 0 if not (since I will be totalling in the
report).


Just add the calculations in new columns. Each one would
look like:

IsYes: IIf(Selection = 1, 1, 0)
 

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