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

Re: Query Amendment - Any Assistance Appreciated!

$
0
0

Okay, that is fortunately an easy one. You have joined INV1 and RIN1, which are the lines tables. However, you do not need them, so give it a try without:

SELECT T0.[DocNum]

     , T0.[DocDate]

     , T0.[CardCode]

     , T0.[CardName]

     , T0.[DocTotalFC]- T0.[DiscSumFC]- T0.[VatSumFC] as 'Total Sales ex GST'

     , T0.[VatSumFC] as 'Total Tax'

     , T0.[DocTotalFC]

     , T0.[GrosProfFC]

     , T0.[DocTotalFC]- T0.[DiscSumFC]- T0.[VatSumFC]-T0.[GrosProfFC] as 'COGS NZD'

FROM OINV T0

WHERE T0.[DocCur] = 'EUR' and (T0.[DocDate] between [%0] and [%1])

 

UNION ALL

 

SELECT T3.[DocNum]

     , T3.[DocDate]

     , T3.[CardCode]

     , T3.[CardName]

     , (T3.[DocTotalFC]- T3.[DiscSumFC]- T3.[VatSumFC]) * -1 as 'Total Sales ex GST'

     , T3.[VatSumFC] * -1 as 'Total Tax'

     , T3.[DocTotalFC] * -1

     , T3.[GrosProfFC] * -1

     , (T3.[DocTotalFC]- T3.[DiscSumFC]- T3.[VatSumFC]-T3.[GrosProfFC]) as 'COGS NZD'

FROM ORIN T3 

WHERE T3.[DocCur] = 'EUR'

  and (T3.[DocDate] between [%0] and [%1])

 

Regards,

Johan


Viewing all articles
Browse latest Browse all 2067

Trending Articles



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