Number of days late

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fdelacruz
    New Member
    • Apr 2010
    • 1

    Number of days late

    I have an open order report. I want to show on the report the number of days the order has been open using the order created date.

    Thank you
  • josephsimonbenn
    New Member
    • Apr 2010
    • 32

    #2
    =DateDiff("d",[OrderCreatedDat e],Now())

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      Joseph's code will do the trick, although I would suggest that you use Date() rather than Now(). You should really get into the habit of only using Now() when you have a definite need for the Time as well as the Date. Mixing the two functions can lead to problems in some situations.

      Welcome to Bytes!

      Linq ;0)>

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        That will work pretty well for you, but a couple of points I'd suggest
        1. Use Date() rather than Now().
        2. Add one to the calculated result, as the date created would be one day rather than zero in the normal way of counting.
        3. Using SQL standard string quotes (' rather than ") makes your code more portable.

        Code:
        =DateDiff('d',[OrderCreated],Date())+1

        Comment

        Working...