In am trying to write a formula to extract the last date from a string of dates in a text field. The data looks like this:
[Touch Date] (Its a string field)
BLANK
1/1/2021
12/12/2021
1/1/2021;#1/2/2021
12/12/2021;#12/13/2021
1/1/2021;#1/2/2021;#1/3/2021
12/12/2021;#12/13/2021;#12/14/2021
so I need to grab the last date weather its 8 to 12 chars
ive tried doing
Right([Touch Date],InStrRev([Touch Date] ,";#))
but it gives me the last several and not the very last
so for this 12/12/2021;#12/13/2021;#12/14/2021
it gives me this ;#12/13/2021;#12/14/2021
when i want just this 12/14/2021
and it could be single or double digit months and days
and if its blank just return a blank
any ideas?
Im sorry I left out the fact that I need to do this in an access query.
Last date: IIf([Touch Date] & ""="",Null,IIf([Touch Date] & ""<>"" And InStr(1,[Touch Date],";#")=0,[Touch Date],Mid([Touch Date],InStrRev([Touch Date],";#")+2)))
try to use the Split function and the separator ";#"
Then get the last element of the returned array and check if it is not blank.
Open in new window
HTHRainer