0

I have a postgresql database field that has a value such as. 1140250673 this is the "time spent on a solution" When I use

To_Char (To_Timestamp (workorder. timespentonreq/1000), 'HH 24 ')

I see only the records with the value of the max 24 hours. What should I use to have a sum of hours or for 1140250673 = 316hrs 44min

1 Answer 1

1

The question isn't entirely clear, but I think you're looking for the interval type:

# select justify_interval(1140250673 / 1000 * '1 second'::interval); justify_interval ------------------ 13 days 04:44:10 (1 row) 
Sign up to request clarification or add additional context in comments.

3 Comments

I get an error when using justify_interval :( I read that I can also use the cast function, just do not know how:(
justify_interval() expects an interval, hence the * '1 second'::interval bit.
I found a similar question and I know how to pull out the hour and minute. Now I just have to connect it in one column.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.