Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to extract date, month and year from existing field?
For example, I have 1 field for date and time but the format is : DD/MM/YY HH.MM.SS
and the data is imported from a database.
How can I extract the date, month and year based on the existing field into 3 new fields?
Hi @duhita ,
You can use the timestamp#() function which interprets the incoming data in the way you outline in the second parameter.
As per your example:
date(timestamp#([Date field], 'DD/MM/YY hh.mm.ss')) as [Date]
month(timestamp#([Date field], 'DD/MM/YY hh.mm.ss')) as [Month]
Year(timestamp#([Date field], 'DD/MM/YY hh.mm.ss')) as [Year]
Documentation on reading in date times
I hope this makes sense.
Regards
Anthony