Dont' display rows based on certain columns being empty?

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Hey All

I've built a Query that pulls in details about certain products in our range.

The problem I've got is that the details for each product live in a text file, it contains details for every product we've ever stocked including some obsolete ones.

Because of this my Query is returning lots of blank rows when there is no SKU associated any more.

The SKUs end up in one of 6 columns at the end of the data.

I thought I'd be able to hide them by using another column to see if they're blank or not and the using a criteria filter.

Code:
Good: IIf(IsNull([Level 0 Live SKU]) And IsNull([Level 1 Live SKU]) And IsNull([Level 2 Live SKU]) And IsNull([Level 3 Live SKU]) And IsNull([Level 4 Live SKU]) And IsNull([Level 5 Live SKU]),"N","Y")

The formula works if I just run the query and the new column populates correctly but when I include the <>"N" criteria I get a "Enter Parameter Value" pop up message box for each of the Level (x) Live SKU fields.

Can I not do it this way? Or am I doing something wrong?

Thanks in advance for any help that can be provided :)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

JonXL

Active Member
Joined
Feb 5, 2018
Messages
455
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Your criteria should be in the Criteria row (or WHERE clause if writing the SQL).

The SQL would be:
Code:
 WHERE Nz([SKU],'') <> ''

The criteria should be able to go under any of the columns in the Criteria row and will look like the SQL minus the WHERE, so:
Code:
 Nz([SKU],'') <> ''
 

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Hi Jon, thanks for response.

"Your criteria should be in the Criteria row" is what I needed :)

I added "Is Not Null" to each column Criteria / Or and that worked.

Thanks for that.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,666
Messages
5,637,662
Members
416,979
Latest member
juliegeorge792

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
Top