Solved

Arrange number ID's in sort

Posted on 2010-11-07
1
273 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 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now