• ScottPletcher - Tuesday, December 19, 2017 11:19 AM

    Not 100% sure what you need, but, for example, this gives sales for the latest quarter for >=7AM and <8AM:


    select *
    from TicketItem
    where s_item IN('Coffee', 'Espresso', 'Double Espresso', 'Decaf Espresso', 'Cappucino', 'Latte', 'Iced Coffee', 'sm coffee pot', 'lg coffee pot')
      and dt_when >= dateadd(quarter, datediff(quarter, 0, getdate()), 0)
      and hour(dt_when) = 7

    And for all of 2017? Thanks for the response, btw. Just change Quarter to Year?

    Looking for sales totals for those menu items for each Q of the 2017 calendar year but only between 7am to 8am, everyday.