Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

Query with most recent applicable criteria?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
twalsh - 27 Feb 2008 20:48 GMT
I have a query that is showing an average of hours worked over 6 weeks. I
need to query by both the range of weeks and by the employee's department.
The issue is that some employees changed department during the 6 weeks. Is
there a way for the query to get the last 6 weeks based on the most recent
weeks department even though not all 6 will have the same department?

For Example:
I want to enter weeks 1 through 6 for the sales dept, how do i enter Sales
as the dept criteria and still get all 6 weeks instead of just the 5 they
were on sales?

Dept     Hours     week
Sales    30          1
Sales    35          2
Sales    36          3
Sales    39          4
Colle     30          5

thanks
MichaelRay - 27 Feb 2008 21:08 GMT
That's not possible with your table structure.  You can't use Sales as a
criteria because some of the records aren't in sales. I'm not sure exactly
what your trying to get at here. Is this a portion of a table that also
contains EmplyeeID, so for each employee you track which department he/she
worked in over the last 6 weeks?

If so, why not just query by Employee, then group the results by Department?
This would tell you how many hours (or the average) that they worked in each
department.

>I have a query that is showing an average of hours worked over 6 weeks. I
>need to query by both the range of weeks and by the employee's department.
[quoted text clipped - 15 lines]
>
>thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.