Skip to Content
Former Member
Feb 15, 2016 at 07:51 AM

Query Help



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'