Need help with a critiria

David_Skov

Active Member
Joined
Jun 29, 2004
Messages
267
I hope the answer is simple :)

If I set up a critiria were the user should choose a category - weeks or products. I know I can use this in a query:

[Choose the week:]

And it works fine, but what if I just wants to show all - as if I removed the critiria from the query? If I choose 40 in the above example, I get the result for week 40, but if I let it blank I get nothing, but I would like to see for all weeks :p

The above might be doable by math, but what with categories like shampoo and Toothpaste? If I leave blank I get no result :p

Help plz ´:)

in advance tx ;) (y)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If you have the Northwinds example db, drop this SQL into a blank query. It shows one method to do what you are asking.
Code:
SELECT Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.ShipCountry
FROM Orders
WHERE ((([Enter the country: Example: 'USA']) Is Null)) OR (((Orders.ShipCountry)=[Enter the country: Example: 'USA']) AND (([Enter the country: Example: 'USA']) Is Not Null));
HTH (y)
P
 
Upvote 0
Hi David,

Have you tried something like this in your query :

iif(IsNull([Choose week]), IsNotNull , [Choose week])

Please note that I haven't tested this (this PC does not have Access). If it doesn't work you might also be able to use an asterisk (e.g. Like *?) instead of the 'IsNotNull' bit.

HTH, Andrew. :)
 
Upvote 0

Forum statistics

Threads
1,221,840
Messages
6,162,311
Members
451,759
Latest member
damav78

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