Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View all info from both queries but with links

Status
Not open for further replies.

hartwell

Technical User
Apr 18, 2005
80
GB
Hi,

Im trying to view all info from both tables with links so if one table doesnt have a record the other will still show and visa versa.

Im looking at a call centre and the times calls come in grouped by half hour(1nd query) and number of people signed on grouped by half hour (2nd query). Link on the date and Half hour slot is a must. I can only get them to show 1way or the other, not both at the same time (need to show all due to running Sum in report)..

Example of what im getting:

Query1 Call Volumes
09:00 20
09:30 22
10:00 20
11:00 15

Query2 SignedOn

08:30 2
09:00 4
11:00 2

Results:

Either:
Time Vol Signedon
09:00 20 4
09:30 22
10:00 20
11:00 15 2

Or:

Time Vol Signedon
08:30 2
09:00 20 4
11:00 15 2

Here is the sql for showing all call volumes

SELECT qry_EBFHO_RBS_HalfHour.*, qry_Signed_On_Count.*
FROM qry_EBFHO_RBS_HalfHour LEFT JOIN qry_Signed_On_Count ON (qry_EBFHO_RBS_HalfHour.TERM_DATE = qry_Signed_On_Count.DATE_STAMP) AND (qry_EBFHO_RBS_HalfHour.HalfHour = qry_Signed_On_Count.HalfHour);
 
Have a look at UNION query

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry dont see how UNION will help in this situation
 
dont see how UNION will help
A starting point:
SELECT A.Time, A.Vol, B.Signedon
FROM Query1 AS A LEFT JOIN Query2 AS B ON A.Time = B.Time
UNION
SELECT B.Time, A.Vol, B.Signedon
FROM Query1 AS A RIGHT JOIN Query2 AS B ON A.Time = B.Time
WHERE A.Time Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top