wildcard for date criteria to return all records

G

Guest

I use an unbound form with combo boxes to select report criteria. In the
query source for the report I have a [inc_date] with the criteria:

Between [Forms]![Myform]![txtBegin] And [Forms]![Myform]![txtend] which
returns all records betwen the dates entered,

I would like to add and "& 'wildcard'" to the critera to return all dates if
none is selected but cannot get a wildcard to work.

Are there any suggestions please??

Thank you
 
D

Douglas J. Steele

You can't use wildcards with dates: they're only for text.

You can try:

Between [Forms]![Myform]![txtBegin] And [Forms]![Myform]![txtend] OR
[Forms]![Myform]![txtBegin] IS NULL OR [Forms]![Myform]![txtend] IS NULL

or

Between Nz([Forms]![Myform]![txtBegin], #1/1/100#) And
Nz([Forms]![Myform]![txtend], #12/31/9999#)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top