query filter for end of current month

D

DRBE

I have a table that contains invoices for clients. I want set up a query that
filters for accounts that are unpaid ie field [accountpaid] = no
and the invoices that are due by the end of the current month.

the query works fine if I use one of the due date field criteria as
< date()
but this only gives the invoices due before today, I want all invoices due
by the end of the month, so I can send reminders out about mid month.

I tried using the query criteria <DateSerial(Year("Date"),Month("Date")+1,0)
but this gives an error "data type mismatch in criteria expression"

would be grateful for any suggestions.
kind regards
Bruce
 
T

tina

the problem is that "Date" is a text value, and the Year() and Month()
functions require a date/time value, hence the "data type mismatch" error
message. try

<DateSerial(Year(Date()),Month(Date())+1,1)

notice, that i also changed the third argument from 0 to 1, because you want
to see dates prior to the first day of next month, correct?

hth
 

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