Adding months to a date

L

Lainni

I am trying to calculate the expiration date for automatically renewing
contracts. I want the final form to calculate the current expiration date by
calculating renewal periods but just showing the final one. The contract is
first signed for a 12, 18, or 24 month period while the renewal period is
usually for 12 months. This is the table:

Tbl: Agreement
ID
Date Signed
First Term
Subsequent Period Term

I got this far in my query and I want to know if I am going along the right
path or if I should go about my goal some other way

SELECT [Supplier Agreement].[Vendor ID], [Supplier Agreement].[Contract
Signed], DateAdd("m",[Contract Signed],[Primary Term of Contract]) AS [End of
First Period], [Supplier Agreement].[Primary Term of Contract]
FROM [Supplier Agreement];

Thank you for your help,
 
K

Ken Snell \(MVP\)

Using the DateAdd function to calculate the future date is the way I'd
probably do this query, so that is good. Is the query working, or are you
having a problem with its results?
 
L

Lainni

Thank you for your help. I got the first future date but I need to add that
date to another field to get a second future date. Can I do all that in one
query or would it be difficult?

Ken Snell (MVP) said:
Using the DateAdd function to calculate the future date is the way I'd
probably do this query, so that is good. Is the query working, or are you
having a problem with its results?

--

Ken Snell
<MS ACCESS MVP>


Lainni said:
I am trying to calculate the expiration date for automatically renewing
contracts. I want the final form to calculate the current expiration date
by
calculating renewal periods but just showing the final one. The contract
is
first signed for a 12, 18, or 24 month period while the renewal period is
usually for 12 months. This is the table:

Tbl: Agreement
ID
Date Signed
First Term
Subsequent Period Term

I got this far in my query and I want to know if I am going along the
right
path or if I should go about my goal some other way

SELECT [Supplier Agreement].[Vendor ID], [Supplier Agreement].[Contract
Signed], DateAdd("m",[Contract Signed],[Primary Term of Contract]) AS [End
of
First Period], [Supplier Agreement].[Primary Term of Contract]
FROM [Supplier Agreement];

Thank you for your help,
 
K

Ken Snell \(MVP\)

It's quite simple -- just repeat the first expression inside the second
DateAdd as the beginning date:

SELECT DateAdd("m", Number, StartDate) AS FirstFutureDate,
DateAdd("m", NextNumber, DateAdd("m", Number, StartDate))
AS SecondFutureDate
FROM TableName;

--

Ken Snell
<MS ACCESS MVP>


Lainni said:
Thank you for your help. I got the first future date but I need to add
that
date to another field to get a second future date. Can I do all that in
one
query or would it be difficult?

Ken Snell (MVP) said:
Using the DateAdd function to calculate the future date is the way I'd
probably do this query, so that is good. Is the query working, or are you
having a problem with its results?

--

Ken Snell
<MS ACCESS MVP>


Lainni said:
I am trying to calculate the expiration date for automatically renewing
contracts. I want the final form to calculate the current expiration
date
by
calculating renewal periods but just showing the final one. The
contract
is
first signed for a 12, 18, or 24 month period while the renewal period
is
usually for 12 months. This is the table:

Tbl: Agreement
ID
Date Signed
First Term
Subsequent Period Term

I got this far in my query and I want to know if I am going along the
right
path or if I should go about my goal some other way

SELECT [Supplier Agreement].[Vendor ID], [Supplier Agreement].[Contract
Signed], DateAdd("m",[Contract Signed],[Primary Term of Contract]) AS
[End
of
First Period], [Supplier Agreement].[Primary Term of Contract]
FROM [Supplier Agreement];

Thank you for your help,
 
L

Lainni

Thank you, it works. I think I make it more complicated than it needs to be
because I have very little experience with it. I have another issue. I need
the current expiration date of the contract which should be sometime in the
future. Each contract has a yearly period end and a final 4 or 5 year end. I
need the yearly period end for this current year. I do not know how to get
the date to refresh itself so that it is current but not past the final
expiration.
I don't know if that is understandable. If it does, please help me or I can
supply more information.

Ken Snell (MVP) said:
It's quite simple -- just repeat the first expression inside the second
DateAdd as the beginning date:

SELECT DateAdd("m", Number, StartDate) AS FirstFutureDate,
DateAdd("m", NextNumber, DateAdd("m", Number, StartDate))
AS SecondFutureDate
FROM TableName;

--

Ken Snell
<MS ACCESS MVP>


Lainni said:
Thank you for your help. I got the first future date but I need to add
that
date to another field to get a second future date. Can I do all that in
one
query or would it be difficult?

Ken Snell (MVP) said:
Using the DateAdd function to calculate the future date is the way I'd
probably do this query, so that is good. Is the query working, or are you
having a problem with its results?

--

Ken Snell
<MS ACCESS MVP>


I am trying to calculate the expiration date for automatically renewing
contracts. I want the final form to calculate the current expiration
date
by
calculating renewal periods but just showing the final one. The
contract
is
first signed for a 12, 18, or 24 month period while the renewal period
is
usually for 12 months. This is the table:

Tbl: Agreement
ID
Date Signed
First Term
Subsequent Period Term

I got this far in my query and I want to know if I am going along the
right
path or if I should go about my goal some other way

SELECT [Supplier Agreement].[Vendor ID], [Supplier Agreement].[Contract
Signed], DateAdd("m",[Contract Signed],[Primary Term of Contract]) AS
[End
of
First Period], [Supplier Agreement].[Primary Term of Contract]
FROM [Supplier Agreement];

Thank you for your help,
 
K

Ken Snell \(MVP\)

It will be very helpful if you can post some examples of the data and the
"expiration date" results that you should get for each example. That will
assist us in identifying a solution for you. Your description does not
provide me with enough information to fully understand what you want to
achieve.
 

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