Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all..........
My startdatetime is 8/1/2013 0:02 so for that how can i saparate date and time .Please help me.
Hi Chandani,
Try this code
Load *,
Date#(SubField(STARTDATETIME,' ',1),'DD/MM/YYYY') as Date,
Month(Date#(SubField(STARTDATETIME,' ',1),'DD/MM/YYYY')) as Month,
Time(SubField(STARTDATETIME,' ',2) )as Time;
Hi,
You can use
Date() to get date only
Time() to get time only
Also you can use subfield()
Like Subfield(dateFieldName,' ',1) as Date,
Subfield(dateFieldName,' ',2) as Time,
Regards
Hi Max..........
Thanx for your answer................Its helpfull for me...........
Date(Startdate,'dd/mm/yyyy') for date and
Time stamp(Startdate,'h:mm:ss[.fff] TT') time
Hi,
You can also use combination of timestamp() and date()
Like
date(timestamp(timestamp#(dateFieldName,''M/D/YYYY h:mm))) as NewDate
Regards
Try this
Simply using Date and Time functions doesn't really split the date and time from a field. It just the changes display value
Date(Floor(startdatetime )) AS StartDate,
Time(Frac(startdatetime )) AS StartTime
Thanks
Hi..........
Now i got my date as 7/31/2013.When i tried to get the month from my date by following script it gives some error..........
Subfield(STARTDATETIME,' ',1) as myDate,
//Date(STARTDATETIME,'dd/mm/yyyy')as mydate,
month(mydate) as mymonth,
Subfield(STARTDATETIME,' ',2) as mytme,
so for that how can i get month from mydate...................
Hi Chandani,
Try this code
Load *,
Date#(SubField(STARTDATETIME,' ',1),'DD/MM/YYYY') as Date,
Month(Date#(SubField(STARTDATETIME,' ',1),'DD/MM/YYYY')) as Month,
Time(SubField(STARTDATETIME,' ',2) )as Time;
Hi,
Try with below
LOAD
*,
Date(Floor(startdatetime )) AS StartDate,
Time(Frac(startdatetime )) AS StartTime
Month(startdatetime) AS StartDateMonth; //Preceding Load statement
LOAD
Date(Date#(startdatetime, 'M/D/YYYY H:m')) AS startdatetime
From ...;
Hi.............
Now i got my exact solution..............