Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 compute sum result cannot show in report,how to
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

Hong Kong
165 Posts

Posted - 08/23/2014 :  08:46:25  Show Profile  Reply with Quote
Everybody know how to display sql compute sum command their result in amount and qty in report?

I am try this query is successful show the total amount and qty in studio management server and show in screen. But run this query on report is without to show last column of qty and amount, why ?


from xsoheader
inner join xsodetail on xsoheader.shopcode + xsoheader.memono = xsodetail.shopcode + xsodetail.memono
inner join xsopayment on xsoheader.shopcode + xsoheader.memono = xsopayment.shopcode + xsopayment.memono
where (xsodetail.sku = 'L000254' or xsodetail.sku='L000256') and xsoheader.voidflag='N' and xsodetail.txdate = CONVERT(varchar(100), GETDATE(), 112)
compute sum(xsopayment.paymentamt) , sum(xsodetail.salesqty)

Aged Yak Warrior

545 Posts

Posted - 08/23/2014 :  12:20:20  Show Profile  Reply with Quote
Probably because the way you join. Try this:
select d.shopcode
  from xsoheader as h
       inner join xsodetail as d
               on d.shopcode=h.shopcode
              and d.memono=h.memono
       inner join xsopayment as p
               on p.shopcode=h.shopcode
              and p.memono=h.memono
 where d.sku in ('L000254','L000256')
   and h.voidflag='N'
   and d.txdate=convert(varchar(100),getdate(),112)
 compute sum(p.paymentamt)
Go to Top of Page

Posting Yak Master

Hong Kong
165 Posts

Posted - 08/23/2014 :  13:35:19  Show Profile  Reply with Quote
Thanks so much ! you are big help to me !!!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000