what i am trying to do is read entries from TransactionReport, if the IsItRes field is true, compare the entries in the TransactionReport table to the Res table otherwise compare to ComTable
Query doesn't work.. please help
SELECT CASE
WHEN IsIsRes = TRUE
THEN
SELECT [TransactionReport].[ServiceType], [TransactionReport].[Weight], [TransactionReport].[Zone], [TransactionReport].[Price], [ResPrice].[Contractprice], [ResPrice].[HistoricPrice], [ResPrice].[ServiceType], [ResPrice].[Weight], [ResPrice].[Zone]
FROM TransactionReport, ResPrice
WHERE ((([ResPrice].[ServiceType]=[TransactionReport].[ServiceType]) And ([ResPrice].[Weight]=[TransactionReport].[Weight]) And ([ResPrice].[Zone]=[TransactionReport].[Zone]))
ELSE
SELECT [TransactionReport].[ServiceType], [TransactionReport].[Weight], [TransactionReport].[Zone], [TransactionReport].[Price], [ComPrice].[Contractprice], [ComPrice].[HistoricPrice], [ComPrice].[ServiceType], [ComPrice].[Weight], [ComPrice].[Zone]
FROM TransactionReport, ComPrice
WHERE (([ComPrice].[ServiceType]=[TransactionReport].[ServiceType]) And ([ComPrice].[Weight]=[TransactionReport].[Weight]) And ([ComPrice].[Zone])=[TransactionReport].[Zone]))
END
Query doesn't work.. please help
SELECT CASE
WHEN IsIsRes = TRUE
THEN
SELECT [TransactionReport].[ServiceType], [TransactionReport].[Weight], [TransactionReport].[Zone], [TransactionReport].[Price], [ResPrice].[Contractprice], [ResPrice].[HistoricPrice], [ResPrice].[ServiceType], [ResPrice].[Weight], [ResPrice].[Zone]
FROM TransactionReport, ResPrice
WHERE ((([ResPrice].[ServiceType]=[TransactionReport].[ServiceType]) And ([ResPrice].[Weight]=[TransactionReport].[Weight]) And ([ResPrice].[Zone]=[TransactionReport].[Zone]))
ELSE
SELECT [TransactionReport].[ServiceType], [TransactionReport].[Weight], [TransactionReport].[Zone], [TransactionReport].[Price], [ComPrice].[Contractprice], [ComPrice].[HistoricPrice], [ComPrice].[ServiceType], [ComPrice].[Weight], [ComPrice].[Zone]
FROM TransactionReport, ComPrice
WHERE (([ComPrice].[ServiceType]=[TransactionReport].[ServiceType]) And ([ComPrice].[Weight]=[TransactionReport].[Weight]) And ([ComPrice].[Zone])=[TransactionReport].[Zone]))
END