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".
 

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

Similar Threads

Function and syntax 1
Date Function 2
Windows 7 Duplicate files. 1
Find then highlight in yellow 6
Missed Opportunity 3
Copy value according to date 1
Arrange data based on two conditions 2
Subtracting time...again 2

Back
Top