Date Calculation - SOS

L

lalexander

Hi All,

I have a date conversion problem.

1. I've calculated the difference between dates from field#1 and field#2

2. I want to add 90 days to the above calculation. ( result example (
07/21/2006 )

3 On result from # 2 above, I want to indicate the 1st of the month.
( eg: 07/01/2006 )


Please Help.


Thanks in advance.
 
M

Michel Walsh

Hi,


1-

DateDiff("d", pastDate, recentDate)

That results into a number of days! not into a date


2-

90 + someDate


will result into a date 90 days after the given date


3-

Day( 90 + someDate)

gives the day, of the month, of the date supplied by 90+ someDate, so


90+someDate -Day(90+someDate)

gives the last day of the last month, and


91 + someDate - Day(90+someDate)

gives one day after, what you want, the first day of the implied
month-year in 90+someDate.



Hoping it may help,
Vanderghast, Access MVP
 
M

Marshall Barton

lalexander said:
I have a date conversion problem.

1. I've calculated the difference between dates from field#1 and field#2

2. I want to add 90 days to the above calculation. ( result example (
07/21/2006 )

3 On result from # 2 above, I want to indicate the 1st of the month.
( eg: 07/01/2006 )


I don't follow that. The difference between tow dates is
not a date, so how can you add 90 days and get another
date??

Regardless, You can use the DateSerial function to specify a
specfic part of a **date value**. For example, if you have
a value such as 7/21/06 in something named mydate, then you
can get 7/1/06 by using:

DateSerial(Year(mydate), Month(mydate), 1)

This is a versatie function so be sure to check Help for
more details.
 
L

lalexander

Thanks for the response.

I apologize for the cryptic explanation.

You were however on target with the DateSerial Function.

That worked well.


Thanks for the response.
 

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