isthisthingon
IS-IT--Management
Here's my problem. I wrote a query and it gives me exactly the results I am looking for:
CREATE PROCEDURE sp_Last_Call
@date smalldatetime
AS
SELECT DISTINCT confermer, status, COUNT(status) as statusCount
FROM TS_DATA
WHERE appt_date = @date AND Status <> 'none' AND Status <> 'never call'
GROUP BY confirmer
Now, I have a need to exclude two things from the results of this query. If (status = 'confirmed' and showed = 'n') and also if (status = 'pending*' and showed = 'n') I need to exclude them from the results. Any help with the easiest way to do this would be appreciated. Thanks for any help!!!!
CREATE PROCEDURE sp_Last_Call
@date smalldatetime
AS
SELECT DISTINCT confermer, status, COUNT(status) as statusCount
FROM TS_DATA
WHERE appt_date = @date AND Status <> 'none' AND Status <> 'never call'
GROUP BY confirmer
Now, I have a need to exclude two things from the results of this query. If (status = 'confirmed' and showed = 'n') and also if (status = 'pending*' and showed = 'n') I need to exclude them from the results. Any help with the easiest way to do this would be appreciated. Thanks for any help!!!!