Subject RE: [firebird-support] UDF Question(s) - a couple more
Author Kevin Stanton
Hi Set,

I think I’ve removed all the dependencies. I rewrote the AgeInMonths in a
stored procedure after looking at the source code for the UDF in FreeUDFLib.

Current_Date does appear to be supported in FB 1.56. And thankfully, the
“Extract” method is also supported so I can get the year, month and day
parts from a date.

Now I just need to figure out an ODBC issue I’m having which is really
bubbling up on the priority scale.



[] On Behalf Of Svein Erling Tysvær
Sent: Monday, March 19, 2012 1:44 AM
Subject: RE: [firebird-support] UDF Question(s) - a couple more

On 16-3-2012 17:13, Kevin Stanton wrote:
> Greetings,
> I believe I'm down to just 3 UDFs and was wondering if there are any
> replacements for:
> Also, is there a place where I can get a list of all functions for FB
> 1.56 (and beyond)? I've taken a quick look but it's not jumping out at me.
>Upgrading to Firebird 2.1 or higher would give you DATEADD and DATEDIFF
>For F_ADDMONTH and F_ADDYEAR you could use the Firebird provided udfs
addMonth and addYear (see

And it ought to be reasonably simple to calculate AgeInMonths on the fly:

(extract(year from current_date)-extract(year from MyBirthDate))*12+
extract(month from current_date)-extract(month from MyBirthDate)-
case when extract(day from current_date) < extract(day from MyBirthDate)
then 1 else 0 end

A couple of things to note:
- I do not have Fb 1.5 available now, and am uncertain whether current_date
is supported
- I've never used F_AGEINMONTHS, but assume it truncates rather than rounds,
e.g. that 29 February 2012 - 30 January 2011 should return 12 and not 13
since it hasn't reached 30 February yet (i.e. 1 March).


[Non-text portions of this message have been removed]