Connecting Tech Pros Worldwide Help | Site Map

Date calculations

  #1  
Old November 13th, 2005, 10:17 AM
Roffee
Guest
 
Posts: n/a
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


  #2  
Old November 13th, 2005, 10:18 AM
Tim Marshall
Guest
 
Posts: n/a

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
  #3  
Old November 13th, 2005, 10:18 AM
MGFoster
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Date Calculations arggg answers 11 March 19th, 2008 06:09 PM
date calculations Charlie Brookhart answers 8 April 26th, 2006 05:26 PM
Workday Date Calculations Wayne answers 1 November 21st, 2005 07:40 AM
Ignore Daylight Savings in Date Calculations? Joe Jax answers 2 September 19th, 2005 11:55 PM
Date calculations in multiple time zones lduperval@gmail.com answers 11 September 17th, 2005 07:55 PM