Date Criteria

  • Thread starter Thread starter michael c
  • Start date Start date
M

michael c

Can anyone see anything wrong with the first part of this
filter that I'm putting in my query's InvoiceDate
criteria? I'm trying to get Invoices for Saturday-Monday
whenever it's Tuesday but the DatePart("w",Date())
=3,Between (Date()-1) And (Date()-3 part of my equation
doesn't work.

IIf(DatePart("w",Date())=3,Between (Date()-1) And (Date()-
3),[Forms]![Dashboard]![Yesterday])
 
Can't quite do it that way.

Try

Between IIF(DatePart("w",Date()=3,Date()-3,Forms!Dashboard!Yesterday)
AND IIF(DatePart("w",Date()=3,Date()-1,Forms!Dashboard!Yesterday)

You can't build the operator part of the criteria, but you can change the
parameter part.
 
Back
Top