Substracting Date field from integer value in another field

From: Abdul Hameed <atheequeahmed(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Substracting Date field from integer value in another field
Date: 2017-08-30 11:20:26
Message-ID: CAOrYCUqNBOuz1zxmLFVqnDD7sNWccwku8ZTe3oT45vLFOV4m0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rene Romero Benavides 2017-08-30 12:52:51 Re: Substracting Date field from integer value in another field
Previous Message David G. Johnston 2017-08-29 01:34:13 Re: Function Code