on 02-15-2016 7:51 AM
Hi,
With the query below, filtering based on posting date doesn't work.
Even within the selection period, it will still display all the records that out of the selected period.
SELECT Case When T0.[DocStatus] = 'C' Then 'Closed' When T0.[DocStatus] = 'O' Then 'Open' End 'Document Status', T0.[DocNum], T0.[DocDate], T3.[ItmsGrpNam], T1.[ItemCode], T1.[WhsCode], T0.[DocRate], T1.[Currency], T1.[Price], T1.[Quantity], T1.[LineTotal], T1.[TrgetEntry], T1.[DocEntry] FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T0.[DocDate] >= [%0] AND T0.[DocDate] <= [%1] AND T1.[WhsCode] <> '002' AND T2.[ItmsGrpCod] = '114' OR T2.[ItmsGrpCod] = '113' OR T2.[ItmsGrpCod] = '122'
Thanks
Hi Olga,
Check below Query.
I only did small Modification in Conditions.
SELECT Case When T0.[DocStatus] = 'C' Then 'Closed' When T0.[DocStatus] = 'O' Then 'Open' End 'Document Status',
T0.[DocNum], T0.[DocDate], T3.[ItmsGrpNam], T1.[ItemCode], T1.[WhsCode], T0.[DocRate], T1.[Currency], T1.[Price],
T1.[Quantity], T1.[LineTotal], T1.[TrgetEntry], T1.[DocEntry]
FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.[DocDate] >= [%0] AND T0.[DocDate] <= [%1] AND T1.[WhsCode] <> '002'
AND T2.[ItmsGrpCod] IN ('114' , '113' , '122')
Hope this helps
--
--
Thanks & Regards::::
Atul Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.