Correct syntax
Started by Sterpu Victoralmost 12 years ago2 messagesgeneral
How would I write sutch a query?
SELECT to_timestamp ('10-10-2013 15:00', 'DD-MM-YYYY HH24:MI') +
interval REPLACE('1.30', '.', ':')||' hours'
This gives error at REPLACE.
Thank you.
Re: Correct syntax
On 04/11/2014 10:58 AM, Victor Sterpu wrote:
How would I write sutch a query?
SELECT to_timestamp ('10-10-2013 15:00', 'DD-MM-YYYY HH24:MI') +
interval REPLACE('1.30', '.', ':')||' hours'
This gives error at REPLACE.
Thank you.
The way you have interval, it expects a constant. You need to cast your
expression like this:
SELECT to_timestamp ('10-10-2013 15:00', 'DD-MM-YYYY HH24:MI') +
(REPLACE('1.30', '.', ':')||' hours')::interval
--
Vik