Skip to Content
0
Former Member
Nov 13, 2009 at 02:29 PM

Error in Query

26 Views

Dear All,

I am unable to get the desired result when i run tthis query in SAP B1. The date selection criteria is not workin. If i remove the date sselection criteria, then the report is working fine.

SELECT DISTINCT T0.[DocNum], T1.[Dscription],T1.[ItemCode],

T0.[DocDate], T1.[Quantity], T1.[Price], T1.[TaxCode], T1.[VatSum],

(Select isnull(Sum(inv4.taxsum),0) from inv4 where T3.statype=-90)BED,

(Select isnull(Sum(inv4.taxsum),0) from inv4 where T3.statype=-60)Cess,

(Select isnull(Sum(inv4.taxsum),0) from inv4 where T3.statype=8)HCess,

(Select isnull(Sum(inv4.taxsum),0) from inv4 where T3.statype=4)CST,taxid11 as TINNO,

( T1.[Quantity]* T1.[Price]) as 'Total Before Discount' ,T0.[DocTotal]

,T0.[DiscPrcnt], T0.[DiscSum], T0.[CardCode],

T0.[CardName], T0.[Comments] FROM OINV T0

INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN

OITM T2 ON T1.ItemCode = T2.ItemCode

inner join inv4 T3 on T1.Docentry =T3.docentry and T1.LineNum=T3.LineNum

inner join CRD7 T4 on T0.cardcode = T4.Cardcode

WHERE ( T0.DocDate >=[%0] AND T0.DocDate <=[%1] )

Please help me to correct this query.

Thanks in advance,

Joseph