Query FROM-TO (1 Viewer)

Portucale

Registered User.
Local time
Today, 07:10
Joined
Sep 7, 2012
Messages
32
Hi,
I have a table containing
WeekNbr
UserID
TagName
CallType
Transfer
TransferCount
The ‘CallType’ is the FROM and the ‘Transfer’ is TO
My aim is to create a Query/Table which would show:
WeekNbr
UserID
‘FROM’
‘TO’
I was able to create two queries for each of FROM and TO, but I would rather t have one Query/Table with the two columns, is that possible?

This is my FROM query:
Code:
SELECT 
Tbl_Transfers.WeekNbr, 
Tbl_Transfers.UserID, 
Tbl_EmployeeAll.EmployeeID, 
Tbl_EmployeeAll.EmployeeName, 
Tbl_Centres.Centre, 
Tbl_Transfers.ServiceCallType, 
Tbl_Transfers.TransferSCT, 
tbl_Genesys.Area
FROM (Tbl_Transfers INNER JOIN (Tbl_EmployeeAll INNER JOIN Tbl_Centres ON Tbl_EmployeeAll.Location = Tbl_Centres.Location) ON Tbl_Transfers.UserID = Tbl_EmployeeAll.UserID) LEFT JOIN tbl_Genesys ON Tbl_Transfers.ServiceCallType = tbl_Genesys.[Service Call Type]
;

and this is my TO Query

Code:
SELECT 
Tbl_Transfers.WeekNbr, 
Tbl_Transfers.UserID, 
Tbl_EmployeeAll.EmployeeID, 
Tbl_EmployeeAll.EmployeeName, 
Tbl_Centres.Centre, 
Tbl_Transfers.ServiceCallType, 
Tbl_Transfers.TransferSCT, 
tbl_Genesys.Area
FROM (Tbl_Transfers INNER JOIN (Tbl_EmployeeAll INNER JOIN Tbl_Centres ON Tbl_EmployeeAll.Location = Tbl_Centres.Location) ON Tbl_Transfers.UserID = Tbl_EmployeeAll.UserID) LEFT JOIN tbl_Genesys ON Tbl_Transfers.TransferSCT = tbl_Genesys.[Service Call Type];

Not sure if I would be able to this in a UNION Query.

Any help and All the help is very much appreciated.
Thanks,
 
Last edited:

pr2-eugin

Super Moderator
Local time
Today, 07:10
Joined
Nov 30, 2011
Messages
8,494
Join the two Queries based on the UserID? Although I am unable to understand your Design :confused:
 

Portucale

Registered User.
Local time
Today, 07:10
Joined
Sep 7, 2012
Messages
32
Hi Paul,

Happy New Year.

Thanks, for the hint, but I was hoping to cut these two queries and just run one from the table and have the two fields.

Hope with the update (SQL of the queries) I better explained what I have...
 

jdraw

Super Moderator
Staff member
Local time
Today, 02:10
Joined
Jan 23, 2006
Messages
15,406
I don't understand WHAT you are trying to accomplish. Can you descride it in more detail or give us an example?
 

Portucale

Registered User.
Local time
Today, 07:10
Joined
Sep 7, 2012
Messages
32
Hi,

This is a Telephony Transfer report and the data containing several columns, however there are two columns (Column A & Column B), which, in Column A contains the source of the call where Column B is where the call was Transferred; in another table I have a the distribution of the Call Skills; i.e. Telephony Skill “SCT_HMBB” is a Service Call and “SCT_WEL” is a Sales call.

So when a customer calls and the call is answered under “SCT_HMBB” and the advisor transfer it to “SCT_WEL” the result would be:

AgentID; AgentName; TransferFrom (SCT_HMBB); TransferTO (SCT_WELL)

So in the query result, I would like to see:

AgentID; AgentName; Service; Sales

Hope this clarifies a bit more what I am trying to do, and in the mean time I have applied Paul’s suggestion which is run separated queries and thereafter run a another query of the two queries…
 

Users who are viewing this thread

Top Bottom