no show if Null

juster21

Well-known Member
Joined
Jun 3, 2005
Messages
867
I'm trying to build a query that will look at one table and only return the fields that have values. The table has 1 record with 10 fields which is used to store parameter values.
I only want the parameters that have been selected and therefore have a value.

Thanks!!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Queries don't quite work like that. You have to explicitly tell it which Fields to include.
If you wanted it to work dynamically and only include Fields that have values, you would probably need to use VBA to build the SQL code for the4 query dynamically, looping through the fields for the records and determining which ones to include in the construction of your dynamic query.

What is it that you actually intend to do with this query when complete?
 
Upvote 0
Queries don't quite work like that. You have to explicitly tell it which Fields to include.
If you wanted it to work dynamically and only include Fields that have values, you would probably need to use VBA to build the SQL code for the4 query dynamically, looping through the fields for the records and determining which ones to include in the construction of your dynamic query.

What is it that you actually intend to do with this query when complete?

I have a report and I am trying to create a subreport that displays the criteria selected by the user.
 
Upvote 0
Depending on how you have written your report, you might be able to do something on the report level to suppress those Null entries.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top