SELECT pp.NetPrice , pp.VatPrice, pp.NetPrice + pp.VatPrice as GrossPrice FROM [invoicing].[ProductPrices] AS [pp] WHERE CAST([pp].[EffectiveAt] AS DATE) <= '2023-09-26 00:00:00.0000000' AND [pp].[CostCode] = 'LCMC02' AND [pp].[Rayon] = 'ZH156' AND ([pp].[CreditorCode] = '1' OR [pp].[CreditorCode] IS NULL OR [pp].[CreditorCode] = '') ORDER BY [pp].[CreditorCode] DESC, [pp].[EffectiveAt] DESC
SELECT [pp].[NetPrice], [pp].[VatPrice], pp.NetPrice + pp.VatPrice as GrossPrice FROM [invoicing].[ProductPrices] AS [pp] WHERE CAST([pp].[EffectiveAt] AS DATE) <= '2023-09-26 00:00:00.0000000' AND [pp].[CostCode] = 'LCMC02' AND [pp].[Rayon] = 'ZH156' AND ([pp].[CreditorCode] = '1' OR [pp].[CreditorCode] IS NULL OR [pp].[CreditorCode] = '') ORDER BY [pp].[CreditorCode] DESC, [pp].[EffectiveAt] DESC