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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

calculating average days



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2010, 12:49 AM posted to microsoft.public.access.queries
JohnL
external usenet poster
 
Posts: 24
Default calculating average days

I am trying to develop a report where in the PartNum footer the
average number of days between orders is calculated. I have
created the following:
Table: tblItemsRecvd
Fields:
PartNum
SupplrName
DateOrdrd
DateRecd
AmtRecd

Query: qryItemsRecvd based on tblItemsRcvd
PartNum Criteria: [Enter PartNum:]
SupplrName
DateOrdrd
DateRecd
AmtRecd

Report: rptItemsRecvd based on qryItemsRecvd

I would like to calculate the average number of days between orders for
the selected part number. Do I do it in the query (how?) or at the report
level (how?)? I am using Access2003 and am a novice.
TIA

  #2  
Old June 7th, 2010, 01:06 AM posted to microsoft.public.access.queries
Jörn Bosse[_3_]
external usenet poster
 
Posts: 20
Default calculating average days

Hi,

i would do this in the query by using the DateDiff-Function.
Take a look at this link:
http://www.techonthenet.com/access/f...e/datediff.php

Regards
Jörn


Am 07.06.2010 01:49, schrieb JohnL:
I am trying to develop a report where in the PartNum footer the
average number of days between orders is calculated. I have
created the following:
Table: tblItemsRecvd
Fields:
PartNum
SupplrName
DateOrdrd
DateRecd
AmtRecd

Query: qryItemsRecvd based on tblItemsRcvd
PartNum Criteria: [Enter PartNum:]
SupplrName
DateOrdrd
DateRecd
AmtRecd

Report: rptItemsRecvd based on qryItemsRecvd

I would like to calculate the average number of days between orders for
the selected part number. Do I do it in the query (how?) or at the report
level (how?)? I am using Access2003 and am a novice.
TIA


  #3  
Old June 7th, 2010, 02:12 AM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default calculating average days

JohnL wrote:

I am trying to develop a report where in the PartNum footer the
average number of days between orders is calculated. I have
created the following:
Table: tblItemsRecvd
Fields:
PartNum
SupplrName
DateOrdrd
DateRecd
AmtRecd

Query: qryItemsRecvd based on tblItemsRcvd
PartNum Criteria: [Enter PartNum:]
SupplrName
DateOrdrd
DateRecd
AmtRecd

Report: rptItemsRecvd based on qryItemsRecvd

I would like to calculate the average number of days between orders for
the selected part number. Do I do it in the query (how?) or at the report
level (how?)? I am using Access2003 and am a novice.



You can do it either place, but the quer would have to be
Totals type query, which may complicate things.

I think it is easier to do in a report with a text box
expression like:
=Avg(DateDiff("d", DateOrdrd, DateRecd))
in either the partNum group header and/or footer section.

--
Marsh
MVP [MS Access]
 




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:53 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.