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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMS ODBC query help

Status
Not open for further replies.

dalley333

Technical User
Sep 3, 2002
40
US
I am looking for some help with an SQL statement out of CMS. We are trying to pull the historical ASA for multiple skills and multiple ACD's. I can get the query to work for a single ACD but as soon as I add ACD's 1 and 3 to the query I do not get a result back. Here is the statement with all 3 ACD's:

select
acd
,split
, sum(anstime)/sum(acdcalls) as ASA
from hsplit
where row_date = today and
acd = 1 and (split = 21) and
acd = 2 and (split = 89 or split = 84 or split = 87 or split = 18 or split = 82 or split = 83 or split = 30 or split = 31 or split = 32 or split = 33) and
acd = 3 and (split = 30 or split = 31 or split = 32 or split = 33 or split = 40 or split = 41)
group by
row_date
, acd
, split

Any help would be GREATLY appreciated!!
 
looks like you are looking for calls that hit all 3 acds and not merely any one of the three acds.

maybe try
...
(acd = 1 and (split = 21)) or
(acd = 2 and (split = 89 or split = 84 or split = 87 or split = 18 or split = 82 or split = 83 or split = 30 or split = 31 or split = 32 or split = 33)) or
(acd = 3 and (split = 30 or split =....
 
I did try that yesterday and it did not work either. I'm not sure what else to try....
 
Did you try breaking the query & running it one at a time, like did you get any result when you ran " ....(acd = 1 and (split = 21)) , I think better way to actually see whether you actually have any records for the query to work or not. I may be wrong but if I would have been in your situation, I would start from basic & than go for the complex query..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top