Text to date conversion
Hello Community,

I am reading values from notepad and storing into entities. Date values are in this format YYYYMMDD (20150410). At the time of storing, I am using this function TextToDate() but values are not getting stored.

Any suggestions?

Suraj Borade
if you would read the manual, chances are the format is incorrect.
Check for example if the TextToDateValidate returns true or not.

If it's false, you have to create an alternative or check out the forge.

Hi Suraj,

Maybe you can use index and subtr to convert YYYYMMDD to YYYY-MM-DD that should work with the texttodate function.


Good Luck

Hi Freek,

I used your solution, I only changed 5 with 4 and 7 with 6:

Substr("YYYYMMDD",0,4) + "-" + Substr("YYYYMMDD",4,2) + "-" + Substr("YYYYMMDD",6,2)


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.