Substract 1 day from date()

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:


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


  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.

Frank FreeseAuthor Commented:
thanks...killed 2 birds with one stone.
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.