If t4.dosage take only positive values.
TRANSLATE(LTRIM(TRANSLATE(CHAR(t4.dosage),' *','0 ')),'0 ',' *')
||t5.dosage_units
Tonkuma - 17 Dec 2005 15:33 GMT
If t4.dosage will take both positive and negative values.
CASE WHEN t4.dosage < 0 THEN '-' ELSE '' END
||TRANSLATE(LTRIM(TRANSLATE(RTRIM(CHAR(t4.dosage)),'','0-')),'0',' ')
||' '||t5.dosage_units
Bob Stearns - 17 Dec 2005 19:19 GMT
> If t4.dosage take only positive values.
> TRANSLATE(LTRIM(TRANSLATE(CHAR(t4.dosage),' *','0 ')),'0 ',' *')
> ||t5.dosage_units
Thank you. Very clever use of reversing translates. Something similar,
with two uses of RTRIM could be used to elide trailing zeroes.