Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Group and Sort on field converted to Number Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: Group and Sort on field converted to Number
    Posted: 31 May 2012 at 5:20am
Hi,
 
I need to be able to group and sort on a data field that I converted from string to number format. However, once I change this field to numeric using tonumber({PREMPGARN.VENDOR}), I get an error message that reads "The String is non-numeric", and the report appears blank.
 
 
So, this field needs to be converted to a number, and the report needs to be grouped on this data field so I can export it To Excel in the desired format.
 
Any suggestions around this issue?
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 01 Jun 2012 at 4:52am
First off, you will have to determine what in the {PREMPGARN.VENDOR} is not a number (embedded space, two periods, embedded dash, etc.).  It may be something that can be removed with another function.
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 01 Jun 2012 at 5:15am
I think it's spaces. I'll need to trim, then I will try "tonumber" and see if that works...
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Jun 2012 at 5:22am
if you use
NOT isnumeric(field)
in the select expert you will get the rows that would not convert
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 01 Jun 2012 at 5:49am
Nice tip! Thanks!Smile
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.