Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning QV addicts,
I am trying to format a TimeStamp in the following way:
YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30)
The issue I am seeing is that the 'T' which signifiies the start of the time component turns the timestamp into text which then means I cannot use MIN, MAX functions on the field. Can anyone advise me on the correct format code to achieve this and retain the field as numeric and not text?
Thanks in advance
Haider
Yes, 'T' in your timestamp format will be translated to either 'P' or 'A' as part of 'TT' resp. 'PM','AM'.
I think you can create your own format while keeping the numeric representation using dual() function:
[assuming a TimeStamp TS with a valid numeric representation]:
LOAD
TS,
dual( Date(TS,'YYYY-MM-DD') &'T' & time(TS,'hh:mm:ss'), num(TS) ) as MyTimeStamp,
...
Yes, 'T' in your timestamp format will be translated to either 'P' or 'A' as part of 'TT' resp. 'PM','AM'.
I think you can create your own format while keeping the numeric representation using dual() function:
[assuming a TimeStamp TS with a valid numeric representation]:
LOAD
TS,
dual( Date(TS,'YYYY-MM-DD') &'T' & time(TS,'hh:mm:ss'), num(TS) ) as MyTimeStamp,
...
Thank you - I'm becoming a little rusty!