I have a column having data in the format 2015-12-24T12:49:38+00:00. I want to extract date (2015-12-24) from this column. I have tried various functions (timestamp, timestamp#, etc) but none helped.
Could anyone help me get a solution for this.
Thanks in advance.
Out of many possible ways, try :
MakeDate(SubField(YourDataField,'-',1), SubField(YourDataField,'-',2),TextBetween(YourDataField,'-','T')) as Date
I tried your solution but i am getting null as a result.
Date(Date#(SubField(trim(endTime), 'T',1), 'YYYY-MM-DD')) As Date
You need to format the enddate field befor you use these functions.
You can even try this:
date(floor(date#('2015-12-24 12:49:38', 'YYYY-MM-DD hh:mm:ss')),'YYYY-MM-DD')
To offer you another alternative (without suggesting it's the best):
Subfield(Data,'T',1) AS Date
This will work if T is a definitive separator between your Date & Time
Retrieving data ...