• here's my first guess on what you are after...some SUM(CASE statements to get your subtotals:

    SELECT SUM(CASE

    WHEN prd_cd='1' OR prd_cd='2' OR pr_cd='3'

    THEN 1

    ELSE 0

    END) AS Processed,

    SUM(CASE

    WHEN prd_cd='X'

    THEN 1

    ELSE 0

    END) AS NotProcessed,

    SUM(CASE

    WHEN prd_cd='1' OR prd_cd='2' OR pr_cd='3' or prd_cd='X'

    THEN 0

    ELSE 1

    END) As UnKown,

    COUNT(*) AS Rules

    FROM

    WHERE CONVERT(date,crt_ts) = CONVERT(date,getdate())

    GROUP BY prd_cd;

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!