crogers111
Technical User
CRXI
SQL
I'm trying to remove the decimal from a string and then pad the right side with zereos until the string is 5 characters in length.
I have the decimal removal working but my loop is failing and returning an error " A string is requried here". I haven't written a loop before so am hoping it's some simple syntax that I'm missing:
Whileprintingrecords;
StringVar Dx1;
Dx1 := {Command.DiagCode};
if Dx1 <> "" then
//removes the decimal
Dx1 := Replace(Trim({Command.DiagCode}),".","");
if len(Dx1)=5 then
Dx1
else
Do
Dx1 := Dx1 & "0"
While
Len(Dx1) < 5
SQL
I'm trying to remove the decimal from a string and then pad the right side with zereos until the string is 5 characters in length.
I have the decimal removal working but my loop is failing and returning an error " A string is requried here". I haven't written a loop before so am hoping it's some simple syntax that I'm missing:
Whileprintingrecords;
StringVar Dx1;
Dx1 := {Command.DiagCode};
if Dx1 <> "" then
//removes the decimal
Dx1 := Replace(Trim({Command.DiagCode}),".","");
if len(Dx1)=5 then
Dx1
else
Do
Dx1 := Dx1 & "0"
While
Len(Dx1) < 5