Connecting Tech Pros Worldwide Help | Site Map

Date calculations

Roffee
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi.

I'm a bit confused about date functions in Access. I need the program to
calculate a new date that lays 15 days ahead of a given date in a table. I
studied the datediff function, but as I see it, it only returns a number of
days (or other time period) between two dates. I need a future date as
output.

Hints anyone?


-roffee


Tim Marshall
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Date calculations


Roffee wrote:
[color=blue]
> I'm a bit confused about date functions in Access. I need the program to
> calculate a new date that lays 15 days ahead of a given date in a table. I
> studied the datediff function, but as I see it, it only returns a number of
> days (or other time period) between two dates. I need a future date as
> output.
>
> Hints anyone?[/color]

Look for the dateadd function

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
MGFoster
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Date calculations


Roffee wrote:[color=blue]
> Hi.
>
> I'm a bit confused about date functions in Access. I need the program to
> calculate a new date that lays 15 days ahead of a given date in a table. I
> studied the datediff function, but as I see it, it only returns a number of
> days (or other time period) between two dates. I need a future date as
> output.[/color]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It might be that you're trying to use a function that will not give you
the correct results. Try reading the Access VBA Help article on
"DateAdd Function." Basically, to get 15 days ahead of a specific date:

NewDate = DateAdd("d", 15, SpecificDate)

Or you can do this

NewDate = SpecificDate + 15

The "d" is an interval indicator. Various others are:

d = day
y = day of year
yyyy = year
q = quarter
m = month
w = weekday
ww = week
h = hours
n = minute
s = second
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQm6lBoechKqOuFEgEQL/FwCaAxkVTmNBD8qiPGCNcgXE2k4A3OAAn1FY
Qtsa9BNYKPwU8YX3Wu0uPvuX
=e4pc
-----END PGP SIGNATURE-----
Closed Thread