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

Need to sum 2 fields

$
0
0

Hi experts

 

i had a query based on oinv and inv1

 

in this 2 field i need to sum and should appear in single line

 

1. The DocTotal Filed

2. The U_Contract Values Filed

 

i had done it but its still showing the same data repeat wise

 

also need to filter the report From Docdate -  To Doc Date

 

The below attache is the Query

 

----------------------------------------------------------------------------------------------------

Select Distinct OINV.CARDCODE,OINV.CARDNAME,OINV.DOCDATE,Sum(OINV.DOCTOTAL) AS 'DocTotal',OCRD.U_ConStartDate 'ContStartDate',

OCRD.U_ConExpiryDate as 'ConExpiryDate',Sum(OCRD.U_ContractValues) as 'Contract Value'

FROM OINV

INNER JOIN INV1 ON OINV.DOCENTRY = INV1.DOCENTRY

INNER JOIN OCRD ON OINV.CARDCODE = OCRD.CARDCODE

WHERE INV1.TARGETTYPE <> 14 AND

OCRD.QryGroup1 = 'Y'

Group by OINV.CARDCODE,OINV.CARDNAME,OINV.DOCDATE,OCRD.U_ConStartDate,

OCRD.U_ConExpiryDate

 

----------------------------------------------------------------------------------

 

Regards

 

Vinod


Viewing all articles
Browse latest Browse all 2803

Trending Articles



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