Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interactive sort differs from T-SQL ORDER BY 1

Status
Not open for further replies.
Dec 27, 2007
56
US
What am I doing wrong? Thanks!

Difference between sort results from query in data tab…

ORDER BY InvoiceOrderNumber,InvoiceOrderLine, InvoiceOrderLineRelease
RESULTS: The report sorts this way until I re-sort it using the interactive sort feature on another field.
Order Line Release
240801 1 0
240801 2 0
240801 3 0
240801 4 0
240801 5 0


… and Interactive sort expression
=Fields!InvoiceOrderNumber.Value & Fields!InvoiceOrderLine.Value & Fields!InvoiceOrderLineRelease.Value
RESULTS: When I try to return the sort to the original way using the interactive sort on the Order field
I get this:
Order Line Release
240801 1 0
240801 10 0
240801 11 0
240801 12 0
240801 13 0

240801 19 0
240801 2 0
240801 20 0
 
You are concatenating numbers together in your report - when you do that, you implicitly convert them to text. In textual comparisons, 10 is after 1. Try:

=Fields!InvoiceOrderNumber.Value + Fields!InvoiceOrderLine.Value + Fields!InvoiceOrderLineRelease.Value

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks! - I just learned the difference between & and + I think.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top