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  

"Joining" multiple queries



 
 
Thread Tools Display Modes
  #1  
Old October 1st, 2008, 12:22 AM posted to microsoft.public.access.queries
jmk
external usenet poster
 
Posts: 29
Default "Joining" multiple queries

Hi All,

This is simple, and I know I have found the answer myself in the past
through trial and error but after days of searching the answer is no closer
to me - and I know it is such a SIMPLE fix...

At any rate, I have a set of queries which calculate employee hours worked
over the past 7 days in different positions. An employee can work in any one
of four positions, but never more than one at a time. The queries are set to
identify how much time is spent in each position.

For example

ID POS1 POS2 POS3 POS4
123 1 52 157 198
..
..
129 52 39 1 157
130 2 29 36 22

Where ID 123 = 2.2 Hours
129 = 1.3 Hours
130 = 4.5 Hours

and 1, 52, 157, etc equal employee ID Numbers.

Employee 1 worked 2.2 hours in position 1 and 1.3 hours in Position 3.

What I need is a query which will combine the hours worked for all employees
(i.e giving a figure of 3.5 hours for employee 1).
The problem is the query I have ignores those employees who only work one
position or when I try to set it up so it will add everything, it ignores all
the data.

What is the way around this? For the life of me I cannot remember how I did
this before, and unfortunately the database it was in is long gone!!!
  #2  
Old October 1st, 2008, 01:56 AM posted to microsoft.public.access.queries
Lord Kelvan
external usenet poster
 
Posts: 637
Default "Joining" multiple queries

you may want to change the join type of the query to a left join from
an inner join

Hope this helps
Regards
Kelvan
  #3  
Old October 1st, 2008, 06:16 AM posted to microsoft.public.access.queries
jmk
external usenet poster
 
Posts: 29
Default "Joining" multiple queries

Thank-you! I actually ended up using a suggestion from another one of your
posts on Union Queries (only because it gave me an excuse to start
programming in SQL) but the left join worked just as well! Thanks again and
much appreciated.

"Lord Kelvan" wrote:

you may want to change the join type of the query to a left join from
an inner join

Hope this helps
Regards
Kelvan

  #4  
Old October 1st, 2008, 08:13 PM posted to microsoft.public.access.queries
Lord Kelvan
external usenet poster
 
Posts: 637
Default "Joining" multiple queries

no problem
 




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 10:14 AM.


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