Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
In my application having an filed CDT with datetime format.
Now i needs to have new field only with hours and minutes.
Ex: My CDT with DateTime format will look like below
CDT
01/01/2013 00:00:15
01/01/2013 00:01:00
01/01/2013 00:50:00
01/01/2013 01:01:00
01/01/2013 13:05:00
01/01/2013 23:50:00
Now i want new field only with Hour ans Minutes as below for above example
NewCDT
0
1
101
50
1305
2350
Please can anyone let me know how to do this.
Thanks in advance.
PFA
Try this
Num(Num#(Text(Timestamp(CDT,'hmm'))))
Hope it helps you..
hi
try this
A:
LOAD *
INLINE [
CDT
01/01/2013 00:00:15
01/01/2013 00:01:00
01/01/2013 00:50:00
01/01/2013 01:01:00
01/01/2013 13:05:00
01/01/2013 23:50:00
];
LOAD *, Date(Date#(CDT,'MM/DD/YYYY hh:mm:ss'),'hhmm') as newCDT
Resident A;
then output like this
| newCDT |
| 0 |
| 1 |
| 50 |
| 101 |
| 1305 |
| 2350 |
Hi. You can also use
Hour(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) as Hours,
Minute(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) as Minute,
Hour(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) & ':' & minute(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) as HM
Alessandro Furtado