query criteria between dates

  • Thread starter Thread starter daniel
  • Start date Start date
D

daniel

in query criteria.
this would show the last 2 weeks. if I look at it on the 15th day, it will
show the correct data.

Between Date()-Weekday(Date(),0)+1 And Date()-Weekday(Date(),0)-13

but if I look at the days on the, say, 10th day, the days would not be
correct anymore.
what formula/code could I use for first of the month to the 15th and from
the 15th to the last day of the month?
 
First 15 days of the month:
= DateSerial(Year(Date()), Month(Date()), 1)
And < DateSerial(Year(Date()), Month(Date()), 16)

16th to end of month:
= DateSerial(Year(Date()), Month(Date()), 16)
And < DateSerial(Year(Date()), Month(Date()+1), 1)

The expressions cope if the field contains time values as well as dates.
 
thank you, Mr. Browne
it works perfect.

Allen Browne said:
First 15 days of the month:
And < DateSerial(Year(Date()), Month(Date()), 16)

16th to end of month:
And < DateSerial(Year(Date()), Month(Date()+1), 1)

The expressions cope if the field contains time values as well as dates.
 
Back
Top