Re: [SQL] date arithmetic with columns

2012-03-06 Thread Peter Faulks
hari.fu...@gmail.com wrote: Peter Faulks writes: I have two columns in two distinct tables, one is the starting time of an event, timestamp without time zone. Data is the utc datetime (for sorting across time zones), the other is the number of minutes to add. Maybe I'm missing somethin

Re: [SQL] date arithmetic with columns

2012-03-03 Thread Peter Faulks
Bit more googling and I came up with: r.utc + CAST( tz.diffmins || ' ' || 'minutes' AS interval) It works, but is it the best way? On 1/03/2012 6:50 AM, Peter Faulks wrote: I have two columns in two distinct tables, one is the starting time of an event, timestamp withou

[SQL] date arithmetic with columns

2012-03-03 Thread Peter Faulks
I have two columns in two distinct tables, one is the starting time of an event, timestamp without time zone. Data is the utc datetime (for sorting across time zones), the other is the number of minutes to add. I am migrating from Firebird. One of the queries uses the dateadd function to build