Re: day interval - Mailing list pgsql-general

From Andrew Gierth
Subject Re: day interval
Date
Msg-id 8736fyxa2a.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to day interval  ("Abraham, Danny" <danny_abraham@bmc.com>)
Responses RE: Re: day interval
List pgsql-general
>>>>> "Abraham" == Abraham, Danny <danny_abraham@bmc.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)



pgsql-general by date:

Previous
From: "Abraham, Danny"
Date:
Subject: day interval
Next
From: "Abraham, Danny"
Date:
Subject: RE: Re: day interval