Math on Date/Time functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How, if possible, can I add anumber to the date function. I have code with a
statement similar to

![DateNow] = Date + ??

which gives a type mismatch. I would like to have DateNow equal to 1 more
than the current date. Thanks in advance

Nick
 
![DateNow] = Date()+1

or...

![DateNow] = DateAdd("D",Date(),1)
* I think the syntax is correct here. check help for the "dateadd"
function.
 
Pretty close, Rick:

![DateNow] = DateAdd("d",1, Date())

--

Ken Snell
<MS ACCESS MVP>

Rick B said:
![DateNow] = Date()+1

or...

![DateNow] = DateAdd("D",Date(),1)
* I think the syntax is correct here. check help for the "dateadd"
function.

--
Rick B



ndunwoodie said:
How, if possible, can I add anumber to the date function. I have code with a
statement similar to

![DateNow] = Date + ??

which gives a type mismatch. I would like to have DateNow equal to 1
more
than the current date. Thanks in advance

Nick
 
Coincidentally, both expressions are correct in this case.

?DateAdd("D", Date(), 1)
26/08/2005

?DateAdd("d", 1, Date())
26/08/2005

Ken's expression is the correct way, though ...

Cheers
Van T. Dinh



Ken Snell said:
Pretty close, Rick:

![DateNow] = DateAdd("d",1, Date())

--

Ken Snell
<MS ACCESS MVP>

Rick B said:
![DateNow] = Date()+1

or...

![DateNow] = DateAdd("D",Date(),1)
* I think the syntax is correct here. check help for the "dateadd"
function.
 
Back
Top