Need help creating query involving dates

H

HWhite

How would I create a query that pulls all entries from table1 that fall
within (including) the 26th of the prior month through 10th of the current
month? I realize I can create this by prompting the user for beginning and
end dates, but these dates will not change and therefore I would like to just
create a query to handle it at the push of a button.

The second query I need includes the 11th of the current month thru the 25th
of the current month.

Thanks for any help!
 
J

John Spencer

Use the following as criteria

Between DateSerial(Year(Date()),Month(Date())-1,26) and
DateSerial(Year(Date()),Month(Date()),10)


2nd set of criteria
Between DateSerial(Year(Date()),Month(Date()),11) and
DateSerial(Year(Date()),Month(Date()),25)


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
K

KARL DEWEY

26th - 10th
Between
DateSerial(Year(DateAdd("m",-1,Date())),Month(DateAdd("m",-1,Date())),26) And
DateSerial(Year(Date()),Month(Date()),10)

11th - 25th
Between DateSerial(Year(Date()),Month(Date()),11) And
DateSerial(Year(Date()),Month(Date()),25)
 
H

HWhite

Thanks John. That's perfect.

John Spencer said:
Use the following as criteria

Between DateSerial(Year(Date()),Month(Date())-1,26) and
DateSerial(Year(Date()),Month(Date()),10)


2nd set of criteria
Between DateSerial(Year(Date()),Month(Date()),11) and
DateSerial(Year(Date()),Month(Date()),25)


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top