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

Non-numeric data

Status
Not open for further replies.

ts04

Technical User
Jun 14, 2004
69
NL
It is me again :)
I have a table field in my database which is a string type:

11AA2222
22BB3333
...

I use some of the numbers of this string for calculations. This tablefield in the database somethimes contains values which only contain alphanumerique values like: "????" or "Error" these string values are unknown so I can't filter on them. How can I filter on data that exsist only in the format like 11AA2222 so the funtion will only use these records for calculating. Now it shows the error: non-numerique valaue when the data passes my 'ToNumber function'

Crystal Reports 9 version

Thanx for the help!

Tanja
 
What about a selction rule such as (use your own names):

Val({aaaaaaa.ttt}) in 10 to 99
and val(right({aaaaaaa.ttt},4)) in 1000 to 9999
and mid({aaaaaaa.ttt},3,2) in "AA" to "ZZ
 
Try this in your selection formula

NumericText(Left({Table.Field},2)) = TRUE AND NumericText(Right({Table.Field},4)) = TRUE

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
if the numbers you want to add are always in the same position of the field then do a mid string and value it
222ddd3333
val(mid(string,7,4)
this would return 3333
i do this thing on date field that are string and need dates
mydate=02/04/2006
month=mid(mydate,1,2)
day=mid(mydate,4,2)
year=mid(mydate,7,4)

then put this to a real date so i can sort by date
date(year,month,day)

jill
860-529-6232
jillm@ccc24k.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top