SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 compute command change to rollup
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

usafelix
Posting Yak Master

Hong Kong
103 Posts

Posted - 08/25/2014 :  08:26:22  Show Profile  Reply with Quote
Anyone can give idea that i want this keep query output result but don't want the "compute " this command , because this query cannot run in this dos command directc.exe , Thus, it is have any writing skill , it is possible using of rollup ?

select d.shopcode
,d.memono
,d.txdate
,d.sku
,h.depositamt
,p.paymentcode
,p.paymentamt
,d.itemamt
,d.salesqty
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)
,sum(d.salesqty)

SwePeso
Patron Saint of Lost Yaks

Sweden
30282 Posts

Posted - 08/25/2014 :  08:48:57  Show Profile  Visit SwePeso's Homepage  Reply with Quote
GROUP BY GROUPING SETS ((p.paymentamt), (d.salesqty));


Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

usafelix
Posting Yak Master

Hong Kong
103 Posts

Posted - 08/25/2014 :  23:49:48  Show Profile  Reply with Quote
Thanks so much !!!!!!!!!!!!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000