Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Arrange number ID's in sort

Posted on 2010-11-07
1
300 Views
Last Modified: 2012-08-13
Experts,

I have a crystal report that I am sorting the Field_ID in ascending order, but it sorts it not like 1 thru 50.  It ends up looking like this.
S1_d
S10_d
S11_d

It should look like this.
S1_d
S2_d
S3_d

I know crystal Reports must have a way of doing this correctly.  If not,  I will have to make a new column in the database's table and name it ID#. The add alphabets to sort.  

ID#     FIELD_ID
A                   S1_d
B                   S2_d
C                   S3_d

Any thoughts?
   
USING CRYSTAL REPORTS 2008 and Oracle 10 G          

0
Comment
Question by:Maliki Hassani
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 34081287
That's because your field is being sorted "alphabetically," and as such, "10" comes before "2". I can't test right now because I don't have access to Oracle, but you could try modifying your ORDER BY to something like:
ORDER BY CAST(REGEXP_REPLACE(Field_ID, '[^[:digit:]]', '') AS INTEGER)

Open in new window

0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question