How to convert text to date

Highlighted
Contributor

How to convert text to date

Hi ,

 

 I have a text formatted line item which is a date .I want to convert it to Date format .

 

I tried to break it into three Year ,Month and day using

 

Value(RIGHT(Line item,4))

Value(Mid(Line item,4,2))

Value(LEFT(line Item,2))

 

It works for 12/10/2012 but what about 2/3/2012 ??

 

Note -- Can't change source text to date format .

3 REPLIES 3
Highlighted
Community Boss

Re: How to convert text to date

You have to identify the day, month, year using the seperators (/). Find the seperator position using the function FIND. Seperate the text between the seperators, using MID.

 

You have to use a combination of FIND, MID and LEN functions to do it.

 

Thanks

Arun

Highlighted
Master Anaplanner/Community Boss

Re: How to convert text to date

@shadmani 

 

Avoid hardcoding the parameters of the syntax - There are many functions that can be put to use here as @ArunManickam already mentioned. FIND, MID,LENGTH,VALUE,RIGHT,LEFT,DATE

 

See below

Misbah_1-1580370763119.png

 

Misbah_0-1580370721864.png

Hope that helps

Misbah

Highlighted
Contributor

Re: How to convert text to date

@Misbah 

 

Thanks for detailed explanation. Looks like it will solve my problem .