michael95677
michael95677

Reputation: 21

crystal reports formula to display each decimal in 8 digit number in a separate field

I've researched this and the formula below works fine for a varchar but my field is a decimal. When trying to substitute my field in I get an error "a string or an array of values is required here".

If I have a 8 digit number and want to display each field one at a time in a separate field how would I go about it?

Local StringVar Message1 :="";
if not isnull({patient_encounter.enc_nbr})
then Message1 := Message1 + {patient_encounter.enc_nbr}[1 to 8] ;
Message1[1 to 1] 

Upvotes: 0

Views: 697

Answers (1)

Siva
Siva

Reputation: 9091

Convert to string and then use

Local StringVar Message1 :="";
if not isnull(ToText({patient_encounter.enc_nbr}))
then Message1 := Message1 + ToText({patient_encounter.enc_nbr})[1 to 8] ;
Message1[1 to 1] 

Upvotes: 1

Related Questions