Substract 1 day from date()

Experts,
I would like to subtract 1 day from date()
Frank FreeseAsked:
Who is Participating?
 
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor President / OwnerCommented:

  What you want to use is the DateAdd() function:

  =DateAdd("d",Now(),-1)

JimD.
0
 
jmoss111Connect With a Mentor Commented:
MyDate = Date() -1
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
oops, got the arguments wrong:

 =DateAdd("d",-1,Now())

  Date/Time fields are also simply a double float with the whole number portion represneting the date, so you could also do:

  =Now() - 1

  But I would use DateAdd() for a number of reasons; it's clearer what's going on, works with every type of period (days, weeks, years, etc) and takes care of the time as well.

JimD.
0
 
Frank FreeseAuthor Commented:
thanks...killed 2 birds with one stone.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.