cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
christianyepez2 Regular Visitor
Regular Visitor

Change text to date

Hello Everyone

 

I got a problem changing my text column into a date colum, i got the date like this 2018-01-10 (yy-mm-dd) but when I use this formula: 

real date =
IF (
    PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL] = "0000-00-00";
    BLANK ();
    DATE ( LEFT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 4 )RIGHT ( LEFT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 4 )2 )RIGHT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 2 ) )
)

my result is wrong: like this 10/6/2019 0:00:00, yes 2019 not 2018!

 

Does anyone Know what is happening?

Also the day is wrong

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Change text to date

Hi @christianyepez2,

 

There existing a mistake when using above formula to extract Month value from text. 

 

Please modify it to:

 

real date =
IF (
    PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL] = "0000-00-00";
    BLANK ();
    DATE ( LEFT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 4 ); RIGHT ( LEFT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 7 ); 2 ); RIGHT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 2 ) )
)

 

Best regards,

Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Super User
Super User

Re: Change text to date

Hi @christianyepez2

 

Does it not work by changing the date type of the column from text to date?

v-yulgu-msft Super Contributor
Super Contributor

Re: Change text to date

Hi @christianyepez2,

 

There existing a mistake when using above formula to extract Month value from text. 

 

Please modify it to:

 

real date =
IF (
    PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL] = "0000-00-00";
    BLANK ();
    DATE ( LEFT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 4 ); RIGHT ( LEFT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 7 ); 2 ); RIGHT ( PP_ORDENESPRODUCCION[FECHA_ENTREGA_REAL]; 2 ) )
)

 

Best regards,

Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 331 members 3,444 guests
Please welcome our newest community members: