C0rinthian
Ars Tribunus Angusticlavius
assuming worst case scenario where you don't know how long each section of the value is, you'll need to use instr to find positions and then substr to pull out portions.
So to pull out the first one, you use instr to find the position of the '.' and then use that to determine the length of the substr to extract:
And then for the second half, you do something similar, but working from the '.' to the end.
instr syntax: instr('String_to_search', 'String_to_find', Start_position, occurrence)
substr syntax: substr('String', start_position, length)
Using a negative value for the start positions starts from the end and counts back. (So a start position of -4 starts 4 characters from the end of the string)
So to pull out the first one, you use instr to find the position of the '.' and then use that to determine the length of the substr to extract:
Code:
substr( '12345.01' , 1 , instr( '12345.01' , '.' )- 1 )
And then for the second half, you do something similar, but working from the '.' to the end.
Code:
substr( '12345.01' , instr( '12345.01' , '.') - length( '12345.01' ))
instr syntax: instr('String_to_search', 'String_to_find', Start_position, occurrence)
substr syntax: substr('String', start_position, length)
Using a negative value for the start positions starts from the end and counts back. (So a start position of -4 starts 4 characters from the end of the string)