Article View: borland.public.interbase.sql
Article #979Re: dates difference
From: Quinn Wildman (CodeGear Develope...
Date: Tue, 03 Apr 2007 16:05
Date: Tue, 03 Apr 2007 16:05
26 lines
1798 bytes
1798 bytes
working example :-):
create procedure substractdates (d1 date, d2 date) returns (dif int)
as begin
dif = d2-d1;
end;
execute procedure substractdates('yesterday', 'tomorrow');
Bill Todd wrote:
> aleplgr wrote:
>
>> Hi! I'm trying to calculate a dates difference in a stored procedure
>> in InterBase 7.5: given two dates in dd/mm/yyyy format I need its
>> difference in days, like this one in SQL 2000:
>> set @Days = (SELECT DATEDIFF(DAY,@val1, @val2))
>>
>> is there a predefined function to do that? couldn't find it in the
>> Language Reference nor Data Reference..
>
> Just subtract one date from the other to get the difference in days.
>
--
CREATE DOMAIN NEW_COMPANY AS CHAR(8) DEFAULT 'CODEGEAR' CHECK (VALUE <>
'BORLAND') NOT NULL;
Technical Details
Message-ID:
<46127b46$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46122eec$1@newsgroups.borland.com> <46126499$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,2c9d003309cca840 X-Google-Attributes: gid114a0e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 03 Apr 2007 09:05:25 -0700 From: "Quinn Wildman (CodeGear Developer Support)" <qwildman@nospam.codegear.com> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Re: dates difference References: <46122eec$1@newsgroups.borland.com> <46126499$1@newsgroups.borland.com> In-Reply-To: <46126499$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 10.143.19.108 Message-ID: <46127b46$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1175616326 10.143.19.108 (3 Apr 2007 09:05:26 -0800) Lines: 26 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail