Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / June 2008

Tip: Looking for answers? Try searching our database.

Grouping

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James Terrington - 30 Jun 2008 07:41 GMT
I have a query that results in the following data

Account No              Amount
4110                        500.00
4120                        600.00
5000                          77.00
5300                          60.00

I would like to create a grouping that will allow me to specify the grouping
ranges that I require so I end up with

Account No              Amount
Income
4110                        500.00
4120                        600.00
Income Total           1100.00

Expense
5000                          77.00
5300                          60.00
Expense Total           137.00

I can create groups on preexisting fields, but at a complete loss to figure
out how to specify the group range myself (even if it is possible)??

Thanks in advance.

James
TheRealRobbie - 30 Jun 2008 08:39 GMT
Hi James,

You can also, instead of just a fieldname, specify an expression as a group.
Suppose you want split just by the first digit of the salary, you could
first convert to varchar and then take the first character as the grouping
expression.
You can also use case statements, so any group split-up should be possible.

Regards,
Rob

> I have a query that results in the following data
>
[quoted text clipped - 24 lines]
>
> James
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.