473,412 Members | 2,003 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,412 software developers and data experts.

Add months to date

I need to add a number of months to a date field to derive a new date
field. I can get the addition to work but it adds the number in days
instead of months. In the example below, I want to add 12 months to the
first field to obtain the derived field. Is there a function that will do
what I want?

Example:

Last Calibrated: 7/25/03
Calibration Cycle: 12 (months)
Calibration Due: 7/25/04 <-- this is the field I want to derive

Thanks in advance
Nov 12 '05 #1
3 24829
=DateAdd("m",12,[LastCalibrated])

"Bob Sanderson" <xn***@LUVSPAMsandmansoftware.com> wrote in message
news:Xn**********************************@167.206. 3.2...
I need to add a number of months to a date field to derive a new date
field. I can get the addition to work but it adds the number in days
instead of months. In the example below, I want to add 12 months to the
first field to obtain the derived field. Is there a function that will do
what I want?

Example:

Last Calibrated: 7/25/03
Calibration Cycle: 12 (months)
Calibration Due: 7/25/04 <-- this is the field I want to derive

Thanks in advance

Nov 12 '05 #2
> I need to add a number of months to a date field to derive a new date
field. I can get the addition to work but it adds the number in days
instead of months. In the example below, I want to add 12 months to the
first field to obtain the derived field. Is there a function that will do
what I want?

Example:

Last Calibrated: 7/25/03
Calibration Cycle: 12 (months)
Calibration Due: 7/25/04 <-- this is the field I want to derive


Try the DateAdd() function:

DateAdd("m", 12, [DateLastCalibrated])

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #3
Bob Sanderson <xn***@LUVSPAMsandmansoftware.com> wrote in
news:Xn**********************************@167.206. 3.2:
I need to add a number of months to a date field to derive a
new date field. I can get the addition to work but it adds
the number in days instead of months. In the example below, I
want to add 12 months to the first field to obtain the derived
field. Is there a function that will do what I want?

Example:

Last Calibrated: 7/25/03
Calibration Cycle: 12 (months)
Calibration Due: 7/25/04 <-- this is the field I want to
derive

Thanks in advance


DateAdd(interval, number, date)

the interval you want is "m", for month.
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tencip | last post by:
Hi everyone, I'm trying to build a simple script that does the following. It should find today's month and year, and then go into a DB query string and look for all records that are from this...
16
by: sandy | last post by:
Hi, Using Java script I am trying to create code where when you place in the start date it automatically calculates 6 months for the experations date. For example when I place 01/01/04 as the...
2
by: sandy | last post by:
Hello, I am trying to automate a date. When typing in the issue date I want it to automatically calculate 6 months fronm the issue date and give me the Expiration date. Following is code that I am...
7
by: bryanilton | last post by:
I was hoping someone could help me with this.. I'm not very familiar with javascript but I'm pretty sure it can help me with what I need to accomplish. I've tried piecing several pieces of script...
2
by: Mary | last post by:
I am trying to develop a query which will determine the average costs using a rolling average of the past 12 months of data. In other words, if I entered the Ship Month of January and the Ship...
3
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location,...
6
by: carl.barrett | last post by:
Hi, I have a continuous form based on a query ( I will also be creating a report based on the same query). There are 2 fields: Date Obtained and Date Of Expiry I want a further 3 columns...
5
by: Juan | last post by:
Hi everyone, is there a function that calculates the exact amount of Years, Months, and Days between two days? TimeDiff is not good enough, since it calculates, for example: Date 1: Dec....
1
by: yaseencarter | last post by:
I have a Store proceture in which two parametres are supplied (Start Date and End date) and in the result only those months appeared which contain data, for example i gave the followig parameters: ...
11
by: Harlin Seritt | last post by:
Is there a module that can pull str values for say the last 3 months? Something like: print lastMonths(3) Thanks
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.