August 2, 2011 at 8:55 am
guys i need help with a report i created....the report has groupings on 2 fields, i tried to create a numbering for it but the numbering does not come out right....i have used rownumber(nothing) and =RunningValue(Fields!Employee_Name.Value,CountDistinct,Nothing) to make the numbering orderly like 1,2, 3...and so on instead it still comes out of order like it will start at 9,23, 90 ....and so on....any help at all is welcome thanks
August 3, 2011 at 8:11 am
Sounds like you have an order by on your select statement that is different than the order by in your row number?
select *, ROW_NUMBER() over (order by N) as RowNum
from Tally
order by NEWID()
This example will get the RowNumber as ordered in the ROW_NUMBER but then I explicitly order the results with an order by that is different. Make sense?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
August 4, 2011 at 12:15 pm
thanks it does make sense, but i wanted to do it in the report and not in the dataset for the report because when i do the groupings in the report, it still wont be orderly
August 4, 2011 at 12:22 pm
It's been a while since I did much in SSRS but here is a link to what I had remembered from MSDN. See if that will get you what you need.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
August 4, 2011 at 12:51 pm
Thanks i really appreaciate all your help
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply