Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interval conversion 1

Status
Not open for further replies.

skicamel

Programmer
Dec 24, 2001
126
0
0
US
I've got a number of tables containing data that comes from outside sources. I'd like to create a unifying view of the key information. The issue is session time. Most of the tables have this information stored in seconds. Some only contain the start & end dates. I can get the session time by substracting the start date from the end date, but the result is an interval type.

Any ideas how to convert an interval into seconds, or the other way around?

Any help would be appreciated. Thanks, all!

Dan

 
Good Lord. I've spent two days on this, and figure out one way minutes after posting here.

cast((timeused ||' seconds') as interval)

I'd still like to hear if anyone knows of any straightforward ways to go from interval to seconds.

Thanks again, folks.

Dan
 
select extract (epoch from interval '1 hour 2 minutes 3 seconds');
 
I could swear that section in the documentation was not there yesterday. *cough* Thanks a million.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top