Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to convert a 16 character string into a number. The tricky thing is, the field is always a 16 character string in the form of:
"000000000001234" or "000000132454623" or "000000012300433".
As the last example suggests, I cannot simply trim all the 0's from the left hand side.
Any help would be much appreciated.
Cheers,
Jason
Temp:
Load Num(Evaluate(Field),'#0') as Field Inline
[
Field
000000000001234
000000132454623
000000012300433
];
Temp:
Load Num(Evaluate(Field),'#0') as Field Inline
[
Field
000000000001234
000000132454623
000000012300433
];
do you need the "0" also in form of number?
then use
num(stringnumber,'0000000000000000')
should work
or what do you want?
Thanks, works like a charm.
No I didn't need the 0. So if it was "000000000001234", I just wanted to return '1234.
You could also try this
LOAD
replace(ltrim(replace(number, '0', ' ')), ' ', 0) as number
Regards
Andy