I am using DATETIME_PARSE, but it has problems with some months in spanish, as you can see in the screenshot.
I am trying to convert those months, but I cant get the way.
Any ideas ??
A collection of nested SUBSTITUTE()
functions should do the job to replace the Spanish abbreviations with their English equivalents (this sample only swaps a few; add more nested functions to cover any missing months with spelling variations):
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
{Fecha Vencimiento}, "ABR", "APR"
), "DIC", "DEC"
), "AGO", "AUG"
)
Wrap that inside a DATETIME_PARSE()
function:
DATETIME_PARSE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
{Fecha Vencimiento}, "ABR", "APR"
), "DIC", "DEC"
), "AGO", "AUG"
), "DD-MMM-YYYY"
)
A collection of nested SUBSTITUTE()
functions should do the job to replace the Spanish abbreviations with their English equivalents (this sample only swaps a few; add more nested functions to cover any missing months with spelling variations):
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
{Fecha Vencimiento}, "ABR", "APR"
), "DIC", "DEC"
), "AGO", "AUG"
)
Wrap that inside a DATETIME_PARSE()
function:
DATETIME_PARSE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
{Fecha Vencimiento}, "ABR", "APR"
), "DIC", "DEC"
), "AGO", "AUG"
), "DD-MMM-YYYY"
)
Thanks Justin, it works perfectly !!
Glad to know that you got the answer you were seeking! If you would, please mark my comment (the one above, not this one) as the solution to your question. This helps others who may be searching with similar questions. Thanks!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.