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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Help in query criteria using wild card option

Status
Not open for further replies.

Jeremiah31

Programmer
Nov 7, 2006
31
US
Don't know how the syntax coding should be written.

Currently I have a form bound to a query. If I run the criteria expression below for a single date value, the query works.

Like IIf([Forms]![frmPalletsFaxedforRA]![EnterStartDate] Is Null,"*",[Forms]![frmPalletsFaxedforRA]![EnterStartDate] & "*")

If I try to write a criteria between two date values, the query crashes.

Between Like IIf([Forms]![frmPalletsFaxedforRA]![EnterStartDate] Is Null,"*",[Forms]![frmPalletsFaxedforRA]![EnterStartDate] & "*") And "Like IIf([Forms]![frmPalletsFaxedforRA]![EnterEndingDate] Is Null,"*",[Forms]![frmPalletsFaxedforRA]![EnterEndingDate] & "*")"

How should I used the wild card between two date values?

I'm trying to set up the form where if the user doesn't input a field it will default to wild card function. I'm open to any suggestions on how to proceed with this problem.
 
Perhaps this ?
(>=[Forms]![frmPalletsFaxedforRA]![EnterStartDate] OR [Forms]![frmPalletsFaxedforRA]![EnterStartDate] IS NULL) AND (<=[Forms]![frmPalletsFaxedforRA]![EnterEndingDate] OR [Forms]![frmPalletsFaxedforRA]![EnterEndingDate] IS NULL)


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top