Link to home
Start Free TrialLog in
Avatar of amcpike
amcpike

asked on

Query of Queries to Return Only Populated Fields in All Queries

Hi All,

This is likely going to be a confusing request, so I apologize. Here is an example of what I am trying to do:

Here are examples of fields in one table of my database:

-Note Number
-Name
-Corrected Name
-Name Correction Needed? (Y/N)
-Address
-Corrected Address
-Address Correction Needed? (Y/N)
-Phone Number
-Corrected Phone Number
-Phone Number Correction Needed? (Y/N)

I have built separate queries to return:
1) All Note Numbers where "Correction Needed" is True for Name
2) All Note Numbers where "Correction Needed" is True for Address
3) All Note Numbers where "Correction Needed" is True for Phone Number

Is there a way to build a query that would say:
For Note Number [Enter Note Number], show me only those fields where "Correction Needed" is True, presumably based on these queries but open to other suggestions.

So if there is a correction needed for Name and Address fields, but not Phone Number fields, I want to see in my query:
Note Number, Name, Corrected Name, Name Correction Needed (True), Address, Corrected Address, Address Correction Needed (True)

I don't want to see any Phone Number fields if there is no change required for that Note Number.

Is this possible?

Thanks,

Andrea
SOLUTION
Avatar of Walter Ritzel
Walter Ritzel
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial