Fares Ayyad

Fares Ayyad

  • NA
  • 36
  • 4.2k

How to print out the summation of a column

Aug 16 2016 6:09 AM

Hello everyone,

I write a query that shows multiple values in multiple columns from multiple:

  1. Select i.cdin_cdindexid as cntdp, coalesce((i.cdin_NoofPackages),0) as sqty,coalesce((i.cdin_WT),0) as swt ,coalesce((i.cdin_volumewt),0) as svwt ,coalesce((i.cdin_MortgageAmount),0) as samt  
  2.                            from cdindex i inner join   company c on i.cdin_CompanyId =c.Comp_CompanyId  inner join Territories t on i.cdin_Secterr =t.Terr_TerritoryID left outer join Performainv p on i.cdin_cdindexid=p.pinv_cdindexid  
  3.                            where(cdin_deleted Is null And c.comp_deleted Is null And t.Terr_Deleted Is null and p.pinv_deleted is null and (p.pinv_InvoiceProperty ='01' or p.pinv_InvoiceProperty is null ) and (p.pinv_Status in('Draft','Posted'or p.pinv_status is null) )  
  4.                            and i.cdin_startunstufdate between '2016-07-01'and '2016-07-11'  
  5.                            group by i.cdin_cdindexid,i.cdin_NoofPackages,i.cdin_WT,i.cdin_volumewt ,i.cdin_MortgageAmount  
And this is the result:
 
 
 
 

my question is how to get the summation of one column an print it in asp label tool.

for Example i want to get the summation of cntdp and represent the result in asp label using C#, if it's possible.

Thank You All.

with my respect.


Answers (4)