Need correct SQL parameter syntax for events due in next 30 days. Criteria=Now()-30 not working

I'm trying to run a query, based on an existing query.
I can't get the following to show which dates are due within a year =Now()-30

The SQL view currently is:
SELECT qryEventDates.*, qryEventDates.EventDate
FROM qryEventDates
WHERE (((qryEventDates.EventDate)=Now()-30));

The query is named 1-DueIn30 in the attached Example database.
Example.zip
LVL 1
Gemini GVBA & Database ProgrammerAsked:
Who is Participating?
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
Without looking into the attachment your query should look like this:
SELECT qryEventDates.*, qryEventDates.EventDate
FROM qryEventDates
WHERE (qryEventDates.EventDate) < Now()+30;

Open in new window

or
SELECT qryEventDates.*, qryEventDates.EventDate
FROM qryEventDates
WHERE (qryEventDates.EventDate) < Now()+30 and (qryEventDates.EventDate)  >= Now()

Open in new window

if you do not want to see events due in the past.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You are asking for events which are exactly due 30 or 365 days ago.
I read "within a year" as "being due from now to now + 365 days", which is significantly different from now - something, but that might be just a language issue.
0
 
Gemini GVBA  & Database ProgrammerAuthor Commented:
Yes sorry looking for tasks due within THE NEXT 30 days.
0
 
Gemini GVBA  & Database ProgrammerAuthor Commented:
That worked perfectly thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.