Rerturn all recrords if parameter is blank

graphage

Board Regular
Joined
Mar 7, 2002
Messages
87
OK, I found some solutions that are close to what I need...but not quite. The solutions I found are related to Forms and Reports.

I have a query with 2 columns. (Email Address and Date Updated)

When I run the query, I want to return any email address that is >= the specified date. If the user leaves the date paramater blank, then I would like for ALL the email addresses to be returned. I used to do this years ago at an old job, and as I recall there was a real easy criteria to use in the query to do this....but I am drawing a blank. Thanks in advance!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I use something like this as the criteria:

Like (IIf(IsNull([Enter transaction]),"*",[Enter transaction] & '*'))

It appears to work.

EDIT

So does this:

Like Nz([Enter transaction] & '*','*')
 
Upvote 0
Both examples appears to work as you wrote them (thanks!)...however, I can't get the >= part of my expression to work. I thought I could just stick it in front of the parameter, but I get an error message telling me that it is typed incorrectly or too complex.
 
Upvote 0
My example was for a text field for a date field you might want to change the * to a date like 01/01/1900.

eg

>=Nz([Enter date],#01/01/1900#)

I tried that against a date and it seemed to work.

When I try with the * against a date field I get the error you mentioned.
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,135
Members
451,743
Latest member
matt3388

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