Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
please help
i have this field
DateTime
1/6/2015 06:10:32PM
i need to extract only 1/6/2015 .
and please that this function didn't work it gives me a empty field:
Date(Floor(Date#(DateTime, 'M/D/YYYY h:mm:ssTT'))) As Date
so i am thinking to use the index function if it works and how to write it is it like this ?
Left(DateTime,index(DateTime," ") as Date ?
then i will get 1/6/2015 ?
Thank you ,
Hi,
did you try:
Date(DateTime,'DD/MM/YYYY') as Date
HTH.
Try this:
Date(Floor(Date#(DateTime, 'M/D/YYYY hh:mm:ss tt')), 'M/D/YYYY') As Date
Your format string isn't correct. There's a preceding 0 before the 6, so the format should have hh:mm instead of h:mm.
Or perhaps your DateTime function is already a timestamp. Have you tried simply date(floor(DateTime),'M/D/YYYY')?
Hi Mario,
Try this if you want to use the Index function:
Left(DateTime,Index(DateTime,' ')-1) as Date
Well Thank you Guyz it works with me like this
Makedate(year(DateTime),Month(DateTime),Day(DateTime)) as Date.
But i need to know why it works like this.
Please test:
Date(Date#(subfield(DateTime,' ',1),'M/D/YYYY'))