Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loading date fields from string values

I've got a question on formating while loading date fields from a source.

Mij date fields has the format "2016-04-07T17:41:01Z"

For this date to be imported as a date field I use 2 replace functions to get rid of the T and Z sign.

In the next step I use Date#( to convert it to a datefield and with Date( I format it.

This looks like this and works

Date(Date#(Replace(Replace(DATEFIELD,  'T',' '),'Z',''), 'YYYY-MM-DD hh:mm:ss'), 'DD-MM-YYYY')              as DATEFIELD

My question;  has anyone a sollution to make this statement simpler / more elegant.

Roland Raijmakers

1 Reply
sunny_talwar

Have you tried this may be:

Date(Date#(Left(DATEFIELD, 10), 'YYYY-MM-DD'), 'DD-MM-YYYY') as DATEFIELD