Skip to Content
0
Former Member
Jan 16, 2009 at 02:13 PM

truncate numbers from string field

17 Views

Afternoon all,

This time I'd like to extract only 2 strings out of a string field. The field is of sales area which contains numbers and letters. For example, Scotland is given a number 01, West midlands is 02, Ireland however is given IR.

however, the field which holds the information is like, 012, where 01 is the area number and 2 is type of area number.

The information which we are interested in is first two strings.

I have tried this in the formula given below but it doesn't work, it states a field is required

If hasvalue({?Sales Area}) then
totext(Minimum({slslsp.slr_slsperson}[1 to 2])) + " - " +
 totext(Maximum({slslsp.slr_slsperson}[1 to 2]))
else
"n/a"

Should I be using a truncate and if yes then how?

P.S. This is to show only the sales area number or text if selected under a parameter. The values of the parameter will stay the same. In other words it is just to show in the report.

Many thanks once again

Regards

Jehanzeb