Untitled
unknown
plain_text
4 months ago
544 B
3
Indexable
SELECT th.Store, YEAR(th.RealDate) & "-" & RIGHT("00" & MONTH(th.RealDate), 2) AS [Month], tt.Tender, SUM(td.Extension), SUM(tt.Amount) FROM (TicketHeader AS th LEFT JOIN TicketTender AS tt ON (th.Ticket = tt.Ticket) AND (th.Store = tt.Store)) LEFT JOIN TicketDetail AS td ON (th.Ticket = td.Ticket) AND (th.Store = td.Store) WHERE th.RealDate >= #3/21/2019 00:00:00# and th.RealDate < #3/22/2019 00:00:00# and th.TransType = 1 and th.Voided = False GROUP BY th.Store, YEAR(th.RealDate) & "-" & RIGHT("00" & MONTH(th.RealDate), 2), tt.Tender;
Editor is loading...
Leave a Comment