cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase Register

Former Member
0 Kudos

Dear Experts

i am creating query on purchase register but when i am running the query i see document no. is appering more than one in few document.I am looking for base document amt .tax amt and document total only.I dont want by row wise report.

can somebody guide me

Thanks

Parikshit

SELECT T0.[DocDate], T0.[TaxDate], T0.[DocNum], T0.[DocType], T2.[GroupName], T0.[CardCode], T0.[CardName],

T0.[LicTradNum],T0.[NumAtCard], T1.[AddID], T0.[Comments], T3.[VatPrcnt], T0.[VatSum], T0.[DocTotal]

FROM [dbo].[OPCH] T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode INNER JOIN OCRG T2 ON T1.GroupCode = T2.GroupCode

INNER JOIN PCH1 T3 ON T0.DocEntry = T3.DocEntry WHERE T0.[DocDate] >=[%0] AND T0.[DocDate] <= [%1]

View Entire Topic
Former Member
0 Kudos

Hi,

Because you have T3.VatPrcnt in the query, it will create multiple lines if you have more than one line in the line detail. You may restrict only one type of T3.VatPrcnt such as T3.VatPrcnt = .14, that can ensure only one line for one document number.

Thanks,

Gordon

Former Member
0 Kudos

Thanks Gordon for your reply.

i have Replace T3.[VatPrcnt] the below error is appering.Somthing wrong i am doing.can you guide me

1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '='. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'Received Alerts' (OAIB) (s) could not be prepared.

Parikshit

Former Member
0 Kudos

You do not need replace it. Only need add T3.VatPrcnt = .14 after Where.

Former Member
0 Kudos

Thanks Gordon

I did as per your instruction ,now is coming "data not found"

Parikshit

Former Member
0 Kudos

I just show an example. You need to enter what your tax rates are.

Former Member
0 Kudos

Thanks Gordon

Even i put my local tax rate still in few document no. is appering more than one. and tax amount and document total

Regards

Parikshit