G
GILBERT
Hi
I need to add filter or parameter that will only include include -1 from
a col named Use from my table tblwebcvp how can I add to the query that was
created in SQL? Thanks enclosed is the syntax
select
min(a.event_date) AS StartDate,
max(a.event_date) AS EndDate,
b.Site,
Count(*) as Surveys,
Case WHEN(SUM(c.CS) + SUM(c.HTS) + SUM(c.KS) + SUM(c.O) + SUM(c.RS)) IS NULL
THEN 0
ELSE CAST((CAST(CAST((SUM(c.CS) + SUM(c.HTS) + SUM(c.KS) + SUM(c.O) +
SUM(c.RS)) AS FLOAT)/(Sum(CVPID)*5) AS NUMERIC(3,2))) * 100 AS INT)
END AS DisSat,
Case WHEN(SUM(c.CSTop) + SUM(c.HTSTop) + SUM(c.KSTop) + SUM(c.OTop) +
SUM(c.RSTop)) IS NULL
THEN 0
ELSE CAST(CAST(CAST((SUM(c.CSTop) + SUM(c.HTSTop) + SUM(c.KSTop) +
SUM(c.OTop) + SUM(c.RSTop)) AS DECIMAL(10,2))/(Sum(CVPID)*5) AS
DECIMAL(10,4)) * 100 AS DECIMAL(10,3))
END AS SatTop
from tblwebcvp a
INNER JOIN tblEIEmployeeInfo b ON a.UID = b.[Employee ID]
INNER JOIN viewWebCVPSummary c ON a.uid = c.uid AND a.event_date =
c.event_date
where a.event_date between '2007-08-01 00:00:00' AND '2007-08-31 23:59:59'
and a.useable = '1'
and b.Site in ('AL','SAT')
and c.CS is not null
and c.HTS is not null
and c.KS is not null
and c.O is not null
group by b.Site
order by b.Site
I need to add filter or parameter that will only include include -1 from
a col named Use from my table tblwebcvp how can I add to the query that was
created in SQL? Thanks enclosed is the syntax
select
min(a.event_date) AS StartDate,
max(a.event_date) AS EndDate,
b.Site,
Count(*) as Surveys,
Case WHEN(SUM(c.CS) + SUM(c.HTS) + SUM(c.KS) + SUM(c.O) + SUM(c.RS)) IS NULL
THEN 0
ELSE CAST((CAST(CAST((SUM(c.CS) + SUM(c.HTS) + SUM(c.KS) + SUM(c.O) +
SUM(c.RS)) AS FLOAT)/(Sum(CVPID)*5) AS NUMERIC(3,2))) * 100 AS INT)
END AS DisSat,
Case WHEN(SUM(c.CSTop) + SUM(c.HTSTop) + SUM(c.KSTop) + SUM(c.OTop) +
SUM(c.RSTop)) IS NULL
THEN 0
ELSE CAST(CAST(CAST((SUM(c.CSTop) + SUM(c.HTSTop) + SUM(c.KSTop) +
SUM(c.OTop) + SUM(c.RSTop)) AS DECIMAL(10,2))/(Sum(CVPID)*5) AS
DECIMAL(10,4)) * 100 AS DECIMAL(10,3))
END AS SatTop
from tblwebcvp a
INNER JOIN tblEIEmployeeInfo b ON a.UID = b.[Employee ID]
INNER JOIN viewWebCVPSummary c ON a.uid = c.uid AND a.event_date =
c.event_date
where a.event_date between '2007-08-01 00:00:00' AND '2007-08-31 23:59:59'
and a.useable = '1'
and b.Site in ('AL','SAT')
and c.CS is not null
and c.HTS is not null
and c.KS is not null
and c.O is not null
group by b.Site
order by b.Site