PDA

View Full Version : [SOLVED:] Data Replacement



JKwan
02-23-2017, 01:20 PM
Wondering if people have an idea to do data replacement within a string:
I currently have this data in a string variable
{"TO_DATE('20170101','YYYYMMDD')";"TO_DATE('20170211','YYYYMMDD')";" = '21237' ";"'1'";"'Thu'";"'4'";"'4'"}

What I need to do is to replace 20170211 with current date, example 20170223. The problem is that date, changes. I don't know how to home in onto that and do a REPLACE, idea?

JKwan
02-23-2017, 02:10 PM
This is what I came up with, don't know if it is best, but it works. Does anyone have a better solution?


Start = InStr(50, Data, "('")
End = InStr(50, Data, "','")
Result = Mid(str, Start + 2, End - Start - 2)