472,127 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Dates

Hope one of you out there can help!

I have a date query to return all dates in 2 months time:

Month(DateAdd("m",2,Date()))

However this seems to be returning dates 2 months ahead for any year. Any ideas?

Also, how can I get the query to bring up overdue dates on the same report.

Any help would be very much appreciated on this topic.

Thanks

stu
Nov 12 '05 #1
6 2560
Stuart Masters previously wrote:
Month(DateAdd("m",2,Date()))


This expression returns the month number (only) of the month that is two
months on from the current month.

Can you explain again what it is you want to get? And where you are
trying to get it.

Peter Russell
Nov 12 '05 #2
I currently have a date column in a table which has the date of next
assessment in it. I use this column in a query to bring up supposed
dates of assessments in two months time.

I would like the expression to work from a query so that, for example,
in the month of May someone who accessed this report based on the query,
would be given only the names of those people due for re-assessment in 2
months time (i.e., July).

Thanks for any help you can provide me with

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Stuart,

Create a calculated field in your query.

Example:
FilterDate:Format([DateField], "mmyyyy")

For the criteria, try
Format(DateAdd("m",2,Date()), "mmyyyy")

This should get the year portion in as well as the month portion. If you
wish, you can uncheck the show box for this field so that it won't be
returned by the query, but just used to filter the results.

--
Wayne Morgan
MS Access MVP
"Stuart Masters" <st************@pcs-tr.swest.nhs.uk> wrote in message
news:40*********************@news.frii.net...
I currently have a date column in a table which has the date of next
assessment in it. I use this column in a query to bring up supposed
dates of assessments in two months time.

I would like the expression to work from a query so that, for example,
in the month of May someone who accessed this report based on the query,
would be given only the names of those people due for re-assessment in 2
months time (i.e., July).

Thanks for any help you can provide me with

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4
Thanks Wayne works a charm. All I need now is to know how to bring up
overdue dates for the same year, i.e., <Now()(how does this work in the
criteria?)

Stu

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
<Now() will work as criteria for a date field. If the field is just a date
(no time) you could also use <Date(). To determine Over Due, I would need a
little more explanation. While you can see if today is past the Due Date,
you also need to check a field to see if the item was accomplished. Do you
want to know if it is still overdue or if it is overdue and was overdue when
accomplished. This will probably require setting criteria on more than one
field.

--
Wayne Morgan
MS Access MVP
"Stuart Masters" <st************@pcs-tr.swest.nhs.uk> wrote in message
news:40*********************@news.frii.net...
Thanks Wayne works a charm. All I need now is to know how to bring up
overdue dates for the same year, i.e., <Now()(how does this work in the
criteria?)

Stu

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #6
Stuart Masters wrote:
Thanks Wayne works a charm. All I need now is to know how to bring up
overdue dates for the same year, i.e., <Now()(how does this work in the
criteria?)

Stu


Do not use NOW() unless comparing dates AND times. If comparing dates
only, you Date or other date functions like Date(), DateSerial, DateAdd,
DateDiff, etc.
Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Riley | last post: by
7 posts views Thread by Alistair | last post: by
5 posts views Thread by PW | last post: by
10 posts views Thread by Colin Steadman | last post: by
1 post views Thread by Don Sealer | last post: by
2 posts views Thread by Rachel Suddeth | last post: by
1 post views Thread by pitfour.ferguson | last post: by
7 posts views Thread by evilcowstare via AccessMonster.com | last post: by
2 posts views Thread by Jim Carlock | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.