• J Livingston SQL (11/14/2015)


    here is one way....this should get you started.....

    SELECT

    CONVERT(varchar(10) , TimeOut , 101) AS yourdate

    , SUM(CASE

    WHEN DATEPART(hour , timeout) >= 12

    AND DATEPART(hour , timeout) < 18 THEN cash

    ELSE 0

    END) AS from12_18

    , SUM(Cash) AS totalday

    FROM mytable

    GROUP BY

    CONVERT(varchar(10) , TimeOut , 101);

    wow, thank you so much. Great! You are the best.