Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Could anyone tell me, plese, why
PurgeChar(peek(debit_date), SubField(peek(debit_date),'-',1))
returns '-8.5.24',
if the incoming string is '100000-08.05.2014'?
Thanks in advance
If I have figured out correctly your problem, i think a possible solution is:
Step1: index the '-' character with the index function
in your specified case index function in debit_date field, for '-' character returns 7
INDEX FUNCTION: index(debit_date,'-')
you have to use this value in the FINAL FUNCTION..
Step2
use the result of the first step to select only the string partyou need (in your case date part)
FINAL FUNCTION: mid(debit_date,index(debit_date,'-'))
This method solve the problem of the debit string lenght.
what exactly output you need?
'-08.05.2014'
try like this
Subfield( Debit_Date,'-',2)
Because the function returns 100000 (1 and 0) as characters to exclude in the string -08.05.2014
SubField(peek(debit_date),'-',2)
forgot the leading '-':
'-'&SubField(peek(debit_date),'-',2)
Or simply
Right(peek(debit_date),11)
if the date format is always the same
Marco, thank you for response.
The problem is that rhe string is not always '100000-08.05.2014' it might be a longer string, containing debt and its start_date.... it might be '100000-08.05.2014-50000-25.04.2014', for example. and i need to evaluate the first subfield (this is the sum of debt to be fully or partly repaid) and leave teh rest part of the string unchanged.
How can i solve it?
The SubField(peek(debit_date),'-',2) solution should work for those field values as well:
regards
Marco