Hello,
How do I combine these two queries so that I dont have to use #temp table.The whole purpose is to get WorkGroup_Id from agent summary table for first select statement resultset
create table #attempts
(cnt int,
ent varchar(20),edt datetime)
insert into #attempts
SELECT COUNT(*)as attempts, enteredby,enterdate FROM t_srvcoli_attempts
WHERE EnterDate BETWEEN '04/01/2005' and '04/02/2005'
group by enteredby,enterdate
order by enteredby,enterdate
select distinct s.workgroup_id,a.ent,a.cnt from #attempts a
inner join AgentSummary s
on s.user_id=a.ent
where s.workgroup_id<>0
AND WorkGroup_Id IN ( 9, 10)
drop table #attempts
How do I combine these two queries so that I dont have to use #temp table.The whole purpose is to get WorkGroup_Id from agent summary table for first select statement resultset
create table #attempts
(cnt int,
ent varchar(20),edt datetime)
insert into #attempts
SELECT COUNT(*)as attempts, enteredby,enterdate FROM t_srvcoli_attempts
WHERE EnterDate BETWEEN '04/01/2005' and '04/02/2005'
group by enteredby,enterdate
order by enteredby,enterdate
select distinct s.workgroup_id,a.ent,a.cnt from #attempts a
inner join AgentSummary s
on s.user_id=a.ent
where s.workgroup_id<>0
AND WorkGroup_Id IN ( 9, 10)
drop table #attempts