473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 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 2680
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Riley | last post by:
The date fields being saved by a VB program were being saved as #2003-11-22#. For reasons unknown to me these dates began to be saved as "11/22/2003" All of these dates were made dates with the...
7
by: Alistair | last post by:
diary_date = request.form("diary_date") - (from a populated drop down list) strSQL = "SELECT saz_title, saz_text from saz_details where saz_date =#" & diary_date & "#" a response.write...
5
by: PW | last post by:
<rant> Sorry guys, but I just have to whinge. Dates in ASP are a total pain in the butt! I seem to get caught out so many times. I realise its my own fault, but going from the posts in this...
10
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: ...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
2
by: Rachel Suddeth | last post by:
Is there a way to have the non-selectable dates (those before MinDate and after MaxDate) draw differently so my users can see right away what dates aren't allowed? I'm not seeing it... ...
12
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is...
1
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie...
7
by: evilcowstare via AccessMonster.com | last post by:
Hi, I have searched the forum for answers on this and to be honest as a novice I find it a bit confusing so apologies if it is simple. There are some searches that I want to apply to my database....
2
by: Jim Carlock | last post by:
(1) Does PHP provide any way to handle dates prior to 1980? I know there's problems with Microsoft Windows NT and all Windows NT operating systems will allow a date prior to 1980 to be placed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.