473,382 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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
Apr 30 '10 #1
3 3518
=DateDiff("d",[OrderCreatedDate],Now())
Apr 30 '10 #2
missinglinq
3,532 Expert 2GB
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
32,556 Expert Mod 16PB
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

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

Similar topics

5
by: The Biscuit Eater | last post by:
Greetings from a second day newbie to php. I think I have figured out a way to explode a field in a csv file (like 11-08-03) and implode it as 031108 and then compare it to the current date(ymd)...
7
by: Shuffs | last post by:
Could someone, anyone please tell me what I need to amend, to get this function to take Sunday as the first day of the week? I amended the Weekday parts to vbSunday (in my code, not the code...
29
by: james | last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old database file that has the date(s) stored in it as number of days. An...
7
by: TheGanjaMan | last post by:
Hi people, I'm stuck on a problem and I was wondering if there was a way around: I'm trying to find the number of lines in a comma delimited text file. I have a progress bar that should...
1
by: jai | last post by:
i have a list of suppliers, each supplies one part for each order so i have a long list of suppliers most of with are duplicated. how do i count the number of orders the supplier has and use this...
9
by: clintonb | last post by:
I'm looking for a way to calculate the number of days between two dates using standard C++ functions. Would it be as simple as just using the difftime() function and then dividing that result by...
5
by: Beemer Biker | last post by:
I cant seem to get that date into any DateTime to make my calculation directly by subtracting "01-01-0000" from "now". After reading this:...
4
realin
by: realin | last post by:
hi guys.. I have made a function which counts the numbers of days or hours or minutes from the current datetime to the give datetime.. but i am confused while displaying number of days along with...
14
by: Tommy Jakobsen | last post by:
Hi. Is there a method in .NET that takes "year" as an argument and returns the total number of weeks in that year? For culture da-DK (Danish). Thanks in advance. Tommy.
1
by: EasyTarget | last post by:
Hello All: I am trying to write a query to determine the number of consecutive days that a conference room is available. The conference room is reserved for an entire day. People want to reserve...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.