Re: Null values in date range, multiple criteria
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Fri, 18 Aug 2006 00:25:11 +0800
Mark, switch the query to SQL View (View menu, in query design.)
Locate the WHERE clause.
Try something like this, replacing "MyDate" with the name of your date
field:
WHERE (([Forms]![FrmSelect]![CmbStatus]="open")
OR ([MyDate] Between [Forms]![FrmSelect]![TxtCloseDate]
And [Forms]![FrmSelect]![txtCloseDate2]))
By way of explanation, a WHERE clause ultimately evalutes to True (select
the record) or False (reject the record.) The clause above consists of 2
parts. With the OR operator, it evaluates to True if either part is true.
So, if the combo contains "open" the clause will evaluate to True for all
records. If the combo does not contain "open", the WHERE clause will be true
only if the other part is true, i.e. if the date is between the 2 values.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Mark in Michigan" <Mark in Michigan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:9378B2B2-8775-4C5F-83BC-4FFEFA4FCF39@xxxxxxxxxxxxxxxx
I'm trying to create a criteria to do the following:
If the "status" control on a form = "open", no criteria (want to pick up
null values).
else:
pick up items within a date range as specified in two other controls.
I'm trying:
IIf([Forms]![FrmSelect]![CmbStatus]="open",Is
Null,<=[Forms]![FrmSelect]![TxtCloseDate] And
=[Forms]![FrmSelect]![txtCloseDate2])
to no avail. Any help much appreciated
.
- Prev by Date: Re: Querying multiple initials fields for report
- Next by Date: Re: Querying multiple initials fields for report
- Previous by thread: Re: Null values in date range, multiple criteria
- Next by thread: Re: Null values in date range, multiple criteria
- Index(es):
Relevant Pages
|