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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query to Average data based on date from another table



 
 
Thread Tools Display Modes
  #1  
Old January 21st, 2009, 05:49 PM posted to microsoft.public.access.gettingstarted
tralbert
external usenet poster
 
Posts: 20
Default Query to Average data based on date from another table

I am working with a DB where I have a table (KDS_INFO) that has the following
fields:

KDSNumber - AutoNumber, primary key
ANumber - Foreign key, employee number from another table
KDSAmount - 3 digit number w/ 2 decimal places
KDSDate - short date/time

In this DB I also have a table CLASS that lists the dates of hire, placement
and 90-day completion dates (short date).

For each ANumber, I need a 30-day, 60-day and 90-day average of the
KDSAmounts where the KDSDates are compared to the PlacementDate and
90DayCompletDate in the CLASS table. So based on the PlacementDate it will
count however many KDSAmounts are between days 1-30, 31-60 and 61-90 and
average accordingly. There will be instances where there will be no
information to average in a time period. In those instances I need the query
to state "N/A".

If I need to provide any more info on this, please let me know.

Thanks!
--
Teri Albert
  #2  
Old January 21st, 2009, 06:46 PM posted to microsoft.public.access.gettingstarted
tralbert
external usenet poster
 
Posts: 20
Default Query to Average data based on date from another table

To update, I changed the CLASS table to include 30-, 60- and 90-day
completion dates to help make things easier to create averages based on those
time parameters.
--
Teri Albert


"tralbert" wrote:

I am working with a DB where I have a table (KDS_INFO) that has the following
fields:

KDSNumber - AutoNumber, primary key
ANumber - Foreign key, employee number from another table
KDSAmount - 3 digit number w/ 2 decimal places
KDSDate - short date/time

In this DB I also have a table CLASS that lists the dates of hire, placement
and 90-day completion dates (short date).

For each ANumber, I need a 30-day, 60-day and 90-day average of the
KDSAmounts where the KDSDates are compared to the PlacementDate and
90DayCompletDate in the CLASS table. So based on the PlacementDate it will
count however many KDSAmounts are between days 1-30, 31-60 and 61-90 and
average accordingly. There will be instances where there will be no
information to average in a time period. In those instances I need the query
to state "N/A".

If I need to provide any more info on this, please let me know.

Thanks!
--
Teri Albert

 




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 12:26 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.