Substract 1 day from date()

Posted on 2008-11-13
Last Modified: 2012-05-05
I would like to subtract 1 day from date()
Question by:Frank Freese
    LVL 56

    Accepted Solution


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


    LVL 18

    Assisted Solution

    MyDate = Date() -1
    LVL 56

    Expert Comment

    by:Jim Dettman (Microsoft MVP/ EE MVE)
    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.


    Author Closing Comment

    by:Frank Freese
    thanks...killed 2 birds with one stone.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now