SELECT dbo.[CRONUS$POS Voided Transaction].[Receipt No_], dbo.[CRONUS$POS Voided Transaction].[Transaction Type],
CASE WHEN [CRONUS$POS Voided Transaction].[Transaction Type] = 0 THEN 'Logoff' WHEN [CRONUS$POS Voided Transaction].[Transaction Type] =
1 THEN 'Logon' WHEN [CRONUS$POS Voided Transaction].[Transaction Type] = 2 THEN 'Sales' WHEN [CRONUS$POS Voided Transaction].[Transaction Type]
= 3 THEN 'Payment' WHEN [CRONUS$POS Voided Transaction].[Transaction Type] = 4 THEN 'Remove Tender' WHEN [CRONUS$POS Voided Transaction].[Transaction Type]
= 5 THEN 'Float Entry' WHEN [CRONUS$POS Voided Transaction].[Transaction Type] = 6 THEN 'Change Tender' WHEN [CRONUS$POS Voided Transaction].[Transaction Type]
= 7 THEN 'Tender Declaration' WHEN [CRONUS$POS Voided Transaction].[Transaction Type] = 8 THEN 'Voided' WHEN [CRONUS$POS Voided Transaction].[Transaction Type]
= 9 THEN 'Open Drawer' WHEN [CRONUS$POS Voided Transaction].[Transaction Type] = 10 THEN 'Neg Adj' WHEN [CRONUS$POS Voided Transaction].[Transaction Type]
= 11 THEN 'Phys Inv' END AS TrxDesc, dbo.[CRONUS$POS Voided Transaction].[Sales Staff], dbo.[CRONUS$POS Voided Transaction].[Store No_],
dbo.[CRONUS$POS Voided Transaction].[POS Terminal No_], dbo.[CRONUS$POS Voided Transaction].[Staff ID],
dbo.[CRONUS$POS Voided Transaction].[Trans_ Date], dbo.[CRONUS$POS Voided Transaction].[Trans_ Time],
dbo.[CRONUS$POS Voided Transaction].[Customer No_], dbo.[CRONUS$POS Voided Trans_ Line].[Line No_],
dbo.[CRONUS$POS Voided Trans_ Line].Number, dbo.[CRONUS$POS Voided Trans_ Line].[Currency Code],
dbo.[CRONUS$POS Voided Trans_ Line].Description, dbo.[CRONUS$POS Voided Trans_ Line].Price,
dbo.[CRONUS$POS Voided Trans_ Line].Quantity, dbo.[CRONUS$POS Voided Trans_ Line].[Net Price],
dbo.[CRONUS$POS Voided Trans_ Line].[VAT _], dbo.[CRONUS$POS Voided Trans_ Line].[Discount Amount],
dbo.[CRONUS$POS Voided Trans_ Line].[Net Amount], dbo.[CRONUS$POS Voided Trans_ Line].[VAT Amount],
dbo.[CRONUS$POS Voided Trans_ Line].Amount, dbo.[CRONUS$POS Voided Infocode Entry].Infocode,
dbo.[CRONUS$POS Voided Infocode Entry].Information, dbo.[CRONUS$POS Voided Infocode Entry].[Info_ Amt_]
FROM dbo.[CRONUS$POS Voided Transaction] LEFT OUTER JOIN
dbo.[CRONUS$POS Voided Infocode Entry] ON
dbo.[CRONUS$POS Voided Transaction].[POS Terminal No_] = dbo.[CRONUS$POS Voided Infocode Entry].[POS Terminal No_] AND
dbo.[CRONUS$POS Voided Transaction].[Store No_] = dbo.[CRONUS$POS Voided Infocode Entry].[Store No_] AND
dbo.[CRONUS$POS Voided Transaction].[Receipt No_] = dbo.[CRONUS$POS Voided Infocode Entry].[Receipt No_] LEFT OUTER JOIN
dbo.[CRONUS$POS Voided Trans_ Line] ON
dbo.[CRONUS$POS Voided Transaction].[POS Terminal No_] = dbo.[CRONUS$POS Voided Trans_ Line].[POS Terminal No_] AND
dbo.[CRONUS$POS Voided Transaction].[Store No_] = dbo.[CRONUS$POS Voided Trans_ Line].[Store No_] AND
dbo.[CRONUS$POS Voided Transaction].[Receipt No_] = dbo.[CRONUS$POS Voided Trans_ Line].[Receipt No_]
WHERE (dbo.[CRONUS$POS Voided Transaction].[Trans_ Date] >= CONVERT(DATETIME, '2016-10-01 00:00:00', 102)) AND
(dbo.[CRONUS$POS Voided Transaction].[Trans_ Date] <= CONVERT(DATETIME, '2017-06-30 00:00:00', 102))
No comments:
Post a Comment