Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Criteria

Status
Not open for further replies.

chippyles

Technical User
Nov 10, 2004
49
0
0
US
I would like to put a BETWEEN START DATE AND END DATE in the criteria of a query I have. The start and end will be from an unbound form, but the person does not have to enter the start or end date all the time.

This code works only when there is data in the combo box.

Between Nz([Forms]![fQA_Raw_Materials]![START],#01/01/1900#) And Nz([Forms]![fQA_Raw_Materials]![END],#12/31/2999#)

I need it to return all values when nothing is in the combo box
 
Have you tried

Between [Forms]![fQA_Raw_Materials]![START] And [Forms]![fQA_Raw_Materials]![END] OR [Forms]![fQA_Raw_Materials]![START] Is Null And [Forms]![fQA_Raw_Materials]![END] Is Null

See how that works.

Paul

 
Hi.

Try something like this

WHERE (((IIf([Forms]![fQA_Raw_Materials]![START] Is Null,1,IIf([Yourfield]>=DateValue([Forms]![fQA_Raw_Materials]![START]) And [YourField]<=DateValue([Forms]![fQA_Raw_Materials]![End]),1,0)))=1));

ChaZ


There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top