include column header in quirey

J

JensB

I have a table with following colums and data types

String yes/no yes/no yes/no
Name Boss Supervisor Employee
and the data in the table:
Peter x
Howard x
Gene x
George x

I want to achive this result
Peter Boss
Howard Employee
Gene Employee
George Supervisor

Is it posible to include the column header as an exprssion in some way?

JensB
 
D

Douglas J. Steele

Your problem is caused by the fact that your table isn't properly
normalized. Field names should never contain data, which is what you've got.

Your table should look like your desired results, not like what you've
currently got. Normally, you're going to have a table of people and a table
of positions, and you're trying to model a many-to-many relationship between
those two tables.
 
C

Cindy

While I agree with Doug that the data isn't normalized, you can write
an awful if statement to take care of this.

This would be the formula in the query:

IIf([boss]="x","Boss",IIf([supervisor]="x","Supervisor",IIf([Employee]="x","Employee","Missing
Data")))

Cindy
 
J

JensB

Thx to Cindy and Doug
I understand your message, but Cindys query solved my little problem.
JensB
Cindy said:
While I agree with Doug that the data isn't normalized, you can write
an awful if statement to take care of this.

This would be the formula in the query:

IIf([boss]="x","Boss",IIf([supervisor]="x","Supervisor",IIf([Employee]="x","Employee","Missing
Data")))

Cindy
 

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