Re: [SQL] Substracting Date field from integer value in another field - Mailing list pgsql-sql

From Rene Romero Benavides
Subject Re: [SQL] Substracting Date field from integer value in another field
Date
Msg-id CANaGW08VGxsgT5EWdyQU7278BDuEyX8VTG=Z7QFHGWBqFkAe=Q@mail.gmail.com
Whole thread Raw
In response to [SQL] Substracting Date field from integer value in another field  (Abdul Hameed <atheequeahmed@gmail.com>)
Responses Re: [SQL] Substracting Date field from integer value in another field  ("Abdul Hameed Kareem -X (abdukare - HCL TECHNOLOGIES LIMITED at Cisco)"<abdukare@cisco.com>)
List pgsql-sql
Try this:
SELECT ACS_TIMESTAMP - acct_session_time * '1 second'::interval  FROM RADIUS_ACC_48

2017-08-30 6:20 GMT-05:00 Abdul Hameed <atheequeahmed@gmail.com>:

Getting below error.


ERROR:  operator does not exist: timestamp with time zone - bigint

LINE 65: ACS_TIMESTAMP-acct_session_time/(24*60*60) ELSE ACS_TIMESTAM..



I have a table with one column as  timestamp (Logon Time), another column as integer(seconds).

I would like to deduct the logon time(timestamp) – integer field(seconds) to get the final value in TIMESTAMP format.


SELECT ACS_TIMESTAMP - acct_session_time   FROM RADIUS_ACC_48


ERROR:  operator does not exist: timestamp with time zone - bigint

LINE 65: ACS_TIMESTAMP-acct_session_time/(24*60*60) ELSE ACS_TIMESTAM..


Please let me know the syntax for that.




--
El genio es 1% inspiración y 99% transpiración.
Thomas Alva Edison
http://pglearn.blogspot.mx/

pgsql-sql by date:

Previous
From: Abdul Hameed
Date:
Subject: [SQL] Substracting Date field from integer value in another field
Next
From: "Abdul Hameed Kareem -X (abdukare - HCL TECHNOLOGIES LIMITED at Cisco)"
Date:
Subject: Re: [SQL] Substracting Date field from integer value in another field