Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: Incorrect Syntax near $38.82.0 in Query

$
0
0

Hi,

 

Your query works fine.

I got another issue here. If I changed T0.VatSumSy to T0.TotalSumSy to capture the total to be charged on tax rate. The FMS query only reads the tax code in the first row. If the invoice got 2 different tax codes with different rate, it will only capture the first row tax rate.

 

E.g.

 

ItemCodeUnitPriceQtyTotalTaxCodeTaxRateTaxAmt
A00110 100 1,000 SR6 60
B00220 200 4,000 ZRE0 0

 

I got 2 UDFs with FMS query.

Tax6%

SELECT sum(T0.[VatSumSy]) FROM INV1 T0 inner join OINV t1 on t1.docentry = t0.docentry WHERE RTRIM($[$-38.18.0]) in ('SR','DS','AJS') and t1.docentry = $[OINV.docentry]


Tax0%

SELECT sum(T0.[VatSumSy]) FROM INV1 T0 inner join OINV t1 on t1.docentry = t0.docentry WHERE RTRIM($[$-38.18.0]) in ('ZRE','RS','GS') and t1.docentry = $[OINV.docentry]


UDF with Tax6% comes out 5000 while UDF with Tax0% also comes out 0.


Kindly guide me how to do on the totalSumSy.


Thanks & BR,

Leng


Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>