Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
sum25041994
Partner - Contributor III
Partner - Contributor III

Add Hour and minutes

Hi,

How to add Hours and minutes and display total minutes in a listbox:

ex: 02:30:00 should be 150 minutes

     05:30:00 should be 330 minutes

     08:00:00 should be 480 minutes.

Regards,

Sumit

14 Replies
rahulpawarb
Specialist III
Specialist III

Hello Sumit,

Field T_Time is from base table which holds the Time values in original format. However, if you need it then you can keep it or else you can drop/do not mention the same (refer below script).

Data: 

LOAD

     (Hour(Time#(T_Time, 'hh:mm:ss TT')) * 60) 

     + Minute(Time#(T_Time, 'hh:mm:ss TT')) AS T_NewTime; 

LOAD * INLINE [ 

T_Time 

02:30:00 AM 

05:30:00 PM 

08:00:00 AM 

12:45:00 AM 

12:45:00 PM 

];

Hope this will be of help.

Regards!

Rahul

sum25041994
Partner - Contributor III
Partner - Contributor III
Author

Thanks Paridhi. it's working

sum25041994
Partner - Contributor III
Partner - Contributor III
Author

Thanks Rahul

rahulpawarb
Specialist III
Specialist III

Cheers,

Rahul

luiferva
Contributor III
Contributor III

Hola, una posible solución que encontre  y lo puedes hacer en expresiones del grafico de esta manera

Hour('02:37:30 AM')*60 + Minute('02:30:30 AM')

Resultado

luiferva_0-1654274683565.png