Re: day interval

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: "Abraham\, Danny" <danny_abraham(at)bmc(dot)com>
Cc: "pgsql-general\(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: day interval
Date: 2019-10-12 15:25:38
Message-ID: 8736fyxa2a.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "Abraham" == Abraham, Danny <danny_abraham(at)bmc(dot)com> writes:

Abraham> Hi
Abraham> A question on day interval

Abraham> select date('20191001') - date('20190923');

Abraham> Will provide sometimes '8' - an integer , but sometimes '8
Abraham> day' - a string

No, it'll always return an integer. You will only get an interval result
if you subtract timestamps rather than dates, for example if one of the
operands is actually an expression returning a timestamp.

Give an example of an actual expression you used that returned an
interval instead, and we may be able to tell you how to fix it.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Abraham, Danny 2019-10-12 15:37:33 RE: Re: day interval
Previous Message Abraham, Danny 2019-10-12 15:21:26 day interval