Text to date conversion

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?

Thanks,
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.

Substr("string",0,4)+"-"+Substr("string",5,2)+"-"+Substr("string",7,2)


Good Luck