Subject | Re: [firebird-support] dates difference function |
---|---|
Author | Richard Wesley |
Post date | 2007-04-04T00:09:21Z |
On Apr 3, 2007, at 03:32, Alejandro Garcia wrote:
other date parts, FreeAdHocUDFLib defines them for all except
quarter, and that one is pretty simple too:
((EXTRACT(YEAR FROM @val2) * 4 + F_QUARTER(@val2)) - (EXTRACT(YEAR
FROM @val1) * 4 + F_QUARTER(@val1)))
You can also do similar tricks with extract for YEAR and MONTH, but
when you get down into week and time values it gets uglier to do it
in line.
HTH,
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html
> Hi! I'm trying to calculate a dates difference in a storedFor DAY the solution given elsewhere in the thread. If you want
> 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..
other date parts, FreeAdHocUDFLib defines them for all except
quarter, and that one is pretty simple too:
((EXTRACT(YEAR FROM @val2) * 4 + F_QUARTER(@val2)) - (EXTRACT(YEAR
FROM @val1) * 4 + F_QUARTER(@val1)))
You can also do similar tricks with extract for YEAR and MONTH, but
when you get down into week and time values it gets uglier to do it
in line.
HTH,
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html