Query based on the first of the month

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to write a query that sort all information after the first on the
current month and year.

So any entery that was made after the first of the current month and year.
With out typing in the current month or year.

Any Ideas???

Thanks....
 
JeffH13 said:
I need to write a query that sort all information after the first on the
current month and year.

So any entery that was made after the first of the current month and year.
With out typing in the current month or year.
assuming no data for next month or beyond

WHERE [datefield] >= DateSerial(Year(Date),Month(Date),1)
 
If you have a field named InvoiceDate, and you want it to show the first of
each month, type this expression into a fresh column in the Field row in
query design:
TheMonth: CVDate([InvoiceDate] - Day([InvoiceDate]) + 1)

If you want to limit the query to only entries for the current month, type
this into the Criteria row of your query, under the date field:
Between CDate(Date() - Day(Date()) + 1) And
DateSerial(Year(Date()), Month(Date()) + 1, 0)
 

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

Back
Top