SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Grouping Row


Grouping Row

Author
Message
Jysafe Lerroy
Jysafe Lerroy
SSC-Enthusiastic
SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)

Group: General Forum Members
Points: 102 Visits: 78
Hi,

My SQL statement gives me the example below output. What I want to do is sort by person and display like the second display below.


SQL Output

Person # Person Name PersonIdent StartDT EndDT PS

1234 Smith, David TMS 2010-01-04 08:30 2010-01-04 18:30 Central

16592 Howard, Rhonda TMS 2010-01-02 09:45 2010-01-02 16:00 Central
16592 Howard, Rhonda TMS 2010-01-04 09:00 2010-01-04 19:15 Central

13718 Cooper, Robyn QMR 2010-01-02 09:45 2010-01-02 16:00 Eastern
13718 Cooper, Robyn QMR 2010-01-04 10:00 2010-01-04 15:00 Eastern
13718 Cooper, Robyn QMR 2010-01-04 16:00 2010-01-04 19:00 Eastern

16437 Arwood, Michael TMS 2010-01-02 09:30 2010-01-02 16:00 Eastern
16437 Arwood, Michael TMS 2010-01-04 09:00 2010-01-04 09:30 Eastern
16437 Arwood, Michael TMS 2010-01-04 09:30 2010-01-04 11:45 Eastern
16437 Arwood, Michael TMS 2010-01-04 11:45 2010-01-04 13:45 Eastern
16437 Arwood, Michael TMS 2010-01-04 14:30 2010-01-04 18:00 E astern


Report Display

Person # Person Name PersonIdent # of Days Hours PS

1234 Smith, David TMS 1 10 Central

16592 Howard, Rhonda TMS 2 16.5 Central

13718 Cooper, Robyn QMR 2 14.25 Eastern

16437 Arwood, Michael TMS 2 14.75 Eastern


I was able to get the # of Days and Hour but it is not grouped, so the Report displays for each row. How can I group the output to display like above?

Thanks,
Ray M
Ray M
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5221 Visits: 1076
Not exactly sure where your issue is cause I cannot see what the issues is, but here's a guess.


In your report I think you need to create a row group.
(Right Click the Left Most Cell of your table on the Detail Row, and Select RowGroup --> Parent Group.

Group by the PersonID, and Check Add Group Header.
Then put all your values on that new row thats created, you can either hide the detail row, or delete it.
Steve-0
Steve-0
SSC-Enthusiastic
SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)

Group: General Forum Members
Points: 130 Visits: 92
I'm having a similar issue. I want to create a group (custom) where I can hide 1TGRCMHC and 1MTGRENW rows and just have the group title with the totals for approved, disbursed and unfunded visable only, unless people wanted to see the source of the total.
Attachments
Capture.PNG (12 views, 6.00 KB)
Ray M
Ray M
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5221 Visits: 1076
Your example does not look like there's a logical grouping available.

You can Hide the detail Row by right clicking the Row And Select Row Visibility --> Hide. and Then Check Display can be toggled by This report Item, and Select the textbox you want to control the hide and show. Which will allow user to see detail if required.
Jysafe Lerroy
Jysafe Lerroy
SSC-Enthusiastic
SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)

Group: General Forum Members
Points: 102 Visits: 78
Hi

Thank you that was very helpfull,

Using Expression in SSRS, how can I select Min and MAX dates?

In other words, is it possible to do the below SQL queiry in SSRS expressoin?

CASE DATEDIFF(dd,MIN(CONVERT(VARCHAR(10),StartDT, 101)),MAX(CONVERT(VARCHAR(10),EndDT, 101))) WHEN 0 THEN 1
ELSE DATEDIFF(dd,MIN(CONVERT(VARCHAR(10),StartDT, 101)),MAX(CONVERT(VARCHAR(10),EndDT, 101))) AS [# of Days],

Thanks,
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search