Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return the name of a field in a table 1

Status
Not open for further replies.

MBorofsky

Programmer
Nov 24, 2004
47
US
I decided to merge a large number of queries into 6 because each set did the same basic thing to a different field in the table.

The way I did this was to create a global variable and a function that would return that variable. I had the front-end set that variable (say to "PCP" or "BF"). I then created a query that would say IIF(Global="PCP", [Primary Care Provider, IIF(Global="BF", [Breast Feeding])).

The problem is that these statements keep getting longer and longer as I add more fields to the reports. They are complex to look at and hard to understand (for the testers). I also believe that they might be making the whole process slower. Is there a way to return or set the name of a field? I can't generate the SQL on my own because the data is complex enough that I need 6 seperate queries (4 of which would need to use the 'return field name' function) to accomplish my task.
 
That was exactly what I was looking for! Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top