If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date Calculation
I have a question...
I am working with a file that say contains dates from January 2009 through June 2009, there are about 189000 record. I can physically look through the file and sort it to find out that the date of the first record may be January 12 and the last date may be June 3. I then once I find these 2 dates want to calculate the number of days that are between the 2 dates to use in a calculation. Is there a way that I can have access via some function look through the values pick out the beginning and the end date and calculate the time elapsed between the2 dates? What i am working on at work is a days in accounts receivable outstanding calculation. Any assistance would be greatly appreciated. |
#2
|
|||
|
|||
Date Calculation
Hi Chris,
Try the following query in the sample Northwind database. Just copy this SQL (Structured Query Language) statement, and paste it into the SQL View of a new query: SELECT Min(Orders.OrderDate) AS [Earliest Order], Max(Orders.OrderDate) AS [Latest Order], DateDiff("d",[Earliest Order],[Latest Order]) AS [Elapsed Days] FROM Orders; Then try running it. If you'd like, you can always switch back to normal query design view, to see a graphical representation of this query. For your database, make the appropriate substitutions for the fieldname, OrderDate, and the name of the table: Orders Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ __________________________________________ "Chris" wrote: I have a question... I am working with a file that say contains dates from January 2009 through June 2009, there are about 189000 record. I can physically look through the file and sort it to find out that the date of the first record may be January 12 and the last date may be June 3. I then once I find these 2 dates want to calculate the number of days that are between the 2 dates to use in a calculation. Is there a way that I can have access via some function look through the values pick out the beginning and the end date and calculate the time elapsed between the2 dates? What i am working on at work is a days in accounts receivable outstanding calculation. Any assistance would be greatly appreciated. |
Thread Tools | |
Display Modes | |
|
|