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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group items together by first number even if item has letter before it

Status
Not open for further replies.
Aug 2, 2005
8
GB
Im using crystal reports xi and i am trying to group item numbers together into groups i.e.
group 1 contains all item numbers that start with a 1*
group 2 contains all items that start with a 2* etc

my problem is some item numbers start with a letter but this can be any random number, therefore no matter what the letter I still require it to go into the group by the first number after the letter i.e if it was A102 i would want it to go into group 1 or w298 would go into group2

any replies would be excellent
 
You need to group by a formula: e.g.
Code:
if NumericText(left{your.code, 1)) 
then left{your.code, 1)
else if NumericText(mid{your.code, 2, 1)) 
then mid{your.code, 2, 1)
else if NumericText(mid{your.code, 3, 1)) 
then mid{your.code, 3, 1)
and so on, depending on your data.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top