Simple Question - Mailing list pgsql-sql

From Terry Lee Tucker
Subject Simple Question
Date
Msg-id 200501111642.21716.terry@esc1.com
Whole thread Raw
Responses Re: Simple Question  (Guy Fraser <guy@incentre.net>)
Re: Simple Question  (Terry Lee Tucker <terry@esc1.com>)
Re: Simple Question  (Michael Fuhr <mike@fuhr.org>)
Re: Simple Question  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: Simple Question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hello:

I'm trying to figure out how to convert a floating point value into an 
interval of time. I'm calculating the time required to drive from point A to 
point B. For the sake of this question, we'll just say it is miles/speed. So:

drv_time = 478 / 45.0;

The value of this is: 10.6222222222222222

Is there a way of converting this value to an interval. It seems that INTERVAL 
only works with a quoted literal value.

If I type:
rnd=# select interval '10.8444444444444444 hours';         interval
----------------------------@ 10 hours 50 mins 40 secs
(1 row)

Anybody have an pointers?

Thanks...

Work: 1-336-372-6812Cell: 1-336-363-4719
email: terry@esc1.com


pgsql-sql by date:

Previous
From: KÖPFERL Robert
Date:
Subject: Re: Single row tables
Next
From: Guy Fraser
Date:
Subject: Re: Simple Question