The function and it usage

M

Michael Lam

Dear All

What is the function and it syntax to add and minus date and time
for Now()

ie Now value is 27-02-2004 11:18 :20
the field want is 4 hrs later or several days later like
27-02-2004 15:18:20 OR 29-02-2004 11:18:20

Plesae advise

Michael Lam
 
F

fredg

Dear All

What is the function and it syntax to add and minus date and time
for Now()

ie Now value is 27-02-2004 11:18 :20
the field want is 4 hrs later or several days later like
27-02-2004 15:18:20 OR 29-02-2004 11:18:20

Plesae advise

Michael Lam

Look up the DateAdd() function in Access help.

+ 4 days
=DateAdd("d",4,Now())

+ 30 minutes
= DateAdd("n",30,Now())

- 2 years
=DateAdd("yyyy",-2,Date())
 
J

John Vinson

Dear All

What is the function and it syntax to add and minus date and time
for Now()

ie Now value is 27-02-2004 11:18 :20
the field want is 4 hrs later or several days later like
27-02-2004 15:18:20 OR 29-02-2004 11:18:20

Plesae advise

Michael Lam

DateAdd() is the function.

To add four hours to the current moment,

DateAdd("h", 4, Now())

To add four days, use "d" instead of "h".
 
M

Michael Lam

THx all
"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> ¦b¶l¥ó
¤¤¼¶¼g...
Dear All

What is the function and it syntax to add and minus date and time
for Now()

ie Now value is 27-02-2004 11:18 :20
the field want is 4 hrs later or several days later like
27-02-2004 15:18:20 OR 29-02-2004 11:18:20

Plesae advise

Michael Lam

DateAdd() is the function.

To add four hours to the current moment,

DateAdd("h", 4, Now())

To add four days, use "d" instead of "h".
 

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