Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
Would anyone know how to strip out the time from a date/time field in a SQL table.
It is displayed like this in the table
2014-04-13 05:50:10.013
I would like to be able to analysis the data by time eg 05:50 from the example above.
Not sure if this is possible or not?
Thanks a lot
Try using the function extract(time from fieldname) under the sql statement.
Hope this helps
Considering your above fieldname from SQL table is TIME, you can achieve the same by preceding load in QlikView Script...
Load
*,
Time(Frac(Timestamp#(TIME,'YYYY-MM-DD hh:mm:ss.fff')),'hh:mm') as RequiredField;
TableName:
SQL SELECT
TIME,
SecondField,
ThirdField......
.....
....
From .....
You can try:
Time(Date, 'hh:mm')
time(date#('2014-04-13 05:50:10.013','YYYY-MM-DD hh:ss:sss'),'hh:mm')
HI
You can try this as well
Mid(Timefield,12,5)
time(timestamp#('2014-04-13 05:50:10.013','YYYY-MM-DD hh:mm:ss.fff'),'hh:mm')
Try using the function extract(time from fieldname) under the sql statement.
Hope this helps
Thanks a lot for your help guys. I used the SQL statement to get this information and this works great..
You can use extract to get year, month, day,hour, minute, second from timestamp in sql
Thank you I will bear that in mind.
What i would like to do is a list box to basically choose the time of orders so between 10:00-11:00, 11:00-12:00, 12:00-13:00 etc.
Would this be achievable do you think?