The function and it usage

  • Thread starter Thread starter Michael Lam
  • Start date Start date
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
 
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())
 
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".
 
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".
 
Back
Top