Convert a datetime to date in SFMC

conversionconvertdatedatetimemarketing-cloud

I have an issue converting a date/time to a string format date. Indeed, I would like to change the following date format : 'mardi 15 mars 2022 4:24 PM' to this format '15/03/2022' without the timedate. Do you know which function could I use to reach that ?

Thansk for your reply

Best Answer

There's the built-in Format function that is perfect for your use case:

Format(YourDate, 'dd/MM/yyyy') as StringifiedDate.

Just remember that your destination data extension fields needs to be of the Text data type (the default length of 50 will be enough for this)

On a side note: I recently had to do the same thing wanting to have my dates readable by Excel and wrote an article about it and the above solution is one of a few approaches that worked.

Related Topic