Home > Archive > MS Access data conversion > January 2006 > Date Calculation - SOS









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Date Calculation - SOS
lalexander

2006-01-17, 1:24 pm


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.





Marshall Barton

2006-01-17, 1:24 pm

lalexander wrote:
> 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(myda
te), Month(mydate), 1)

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

--
Marsh
MVP [MS Access]
Michel Walsh

2006-01-17, 1:24 pm

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



"lalexander" < lalexander@bsiinsura
nce.com> wrote in message
news:eI8phU5GGHA.524@TK2MSFTNGP09.phx.gbl...
>
> 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.
>
>
>
>
>



lalexander

2006-01-17, 8:25 pm

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.



"Marshall Barton" <marshbarton@wowway.com> wrote in message
news:o5fqs1pdnou4ibe
m581t2lqfrpvjeqbeh1@
4ax.com...
> lalexander wrote:
>
>
> 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(myda
te), Month(mydate), 1)
>
> This is a versatie function so be sure to check Help for
> more details.
>
> --
> Marsh
> MVP [MS Access]



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com