Compare two amount in column in Sql Server QueryI want to compare two amount column.Column Name is (1)camount(Contract Amount) (2) paymenttilldate(Payment Till Date Amount)
If Contact Amount is Equal to Payment Till Date Amount Then Remaining Days will not calculate means it show blank .
If Contact Amount is Greater Than or Less Than to Payment Till Date Amount Then Remaining Days will calculate menas Remaining days will shows.
My Query is Given below:
select contractno,camount, (ISNULL (sum(ActualPayment + AdvanceAdjustment),0)) as paymenttilldate,
(CASE WHEN tbl_contract.RevisedDate IS NULL or tbl_contract.RevisedDate=''
THEN CONVERT(varchar, DATEDIFF(DAY,getdate(),tbl_contract.edate))
else CONVERT(varchar,DATEDIFF(DAY,getdate(),tbl_contract.RevisedDate))end) as RemainingDay
left join tbl_ContractAmountMileStone on tbl_ContractAmountMileStone.ContractId= tbl_contract.contractid --Add 3 Aug 2015 For payment Till date
group BY camount,tbl_contract.contractid,tbl_contract.contractno,tbl_contract.RevisedDate,tbl_contract.edate
order by contractno