A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date Calculation



 
 
Thread Tools Display Modes
  #1  
Old July 14th, 2009, 05:41 AM posted to microsoft.public.access
chris
external usenet poster
 
Posts: 2,039
Default 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  
Old July 14th, 2009, 07:17 AM posted to microsoft.public.access
Tom Wickerath
external usenet poster
 
Posts: 3,914
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.