By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,374 Members | 2,993 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,374 IT Pros & Developers. It's quick & easy.

Number of days late

P: 1
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
Apr 30 '10 #1
Share this Question
Share on Google+
3 Replies


P: 32
=DateDiff("d",[OrderCreatedDate],Now())
Apr 30 '10 #2

missinglinq
Expert 2.5K+
P: 3,532
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)>
Apr 30 '10 #3

NeoPa
Expert Mod 15k+
P: 31,494
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.
Expand|Select|Wrap|Line Numbers
  1. =DateDiff('d',[OrderCreated],Date())+1
Apr 30 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.