0

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

2

2 Answers 2

1

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.

1

This can be done using the following SQL function (CONVERT):

SELECT CONVERT([data type], [value to convert], [style])

The values inside the [] should be replaced with the values you would use:

[data type] = This is the target data type to be converted. In your case, it would be datetime.

[value to convert] = the field in which you wish to convert to your desired date format.

[style] = the format in which you would like to convert to. In your case, this would be 3, but you can get a list of the options here.

Find out more about the CONVERT function here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .