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
 Sum query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

masond
Constraint Violating Yak Guru

447 Posts

Posted - 12/19/2012 :  06:02:57  Show Profile  Reply with Quote

Hey guys

Really stupid question but need some help

This is my query,

SELECT 'Foreign -issued cards total Transactions and Gross Sales',
SUM([hst_sales_tran_R12]) AS [Transactions],
SUM([hst_sales_amt_R12]) AS [Gross Sales]
FROM [Fact_Financial_History_2] INNER JOIN Dim_Interchange_Tier_2 ON
Fact_Financial_History_2.hst_prod_code + '-' + Fact_Financial_History_2.hst_plan_code = Dim_Interchange_Tier_2.Plan_Code
WHERE Region in ('EU', 'INT')
GROUP BY Dim_Interchange_Tier_2.region


When i run the query it is producing the following results

(No column name) Transactions Gross Sales
Foreign -issued Sales 2554838 228653784.13
Foreign -issued Sales 2178699 228165015.92

Is there anyway i can get them transactions/gross sales to be on a one liner ?

For instance
(No column name) Transactions Gross Sales
Foreign -issued Sales 4733537 456818800.1

Would appreciate any help available






bandi
Flowing Fount of Yak Knowledge

India
2206 Posts

Posted - 12/19/2012 :  06:39:06  Show Profile  Reply with Quote
Try this...

WHERE Region in ('EU', 'INT')
GROUP BY Dim_Interchange_Tier_2.region



--
Chandu
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