Firebird functions

No expert in SQL, I’m having great difficulty finding the syntax of firebird and in particular its functions. Is there a good reference to the version of firebird used in Base v6?

Then how do I use the DATEDIFF function (which appears to be different to the forme HSQLDB)? I have in a SELECT statement:
DATEDIFF( year, “DOB”, “TestDate”) “Age”
but it is creating SQL syntax error.

Any advice appreciated.

Hello,

Yes there are a number of differences in Firebird which may require changes in your SQL. Please see my answer in this post → Firebird Migration Expectations.

That post also contains a link to the Firebird documentation which has the reference manual for SQL.

The only difference in the DATEDIFF function is:

DATEDIFF (note "Unit" surrounded by apostrophe):

HSQL     - DATEDIFF( 'year', "DATE1", CURRENT_TIMESTAMP )
Firebird - DATEDIFF( year, "DATE1", CURRENT_TIMESTAMP )

This statement just tested works:

Select DATEDIFF( year, "DATE1", "DATE2" ) "MyDate" from "DateCompare"

Have you turned on Run SQL command directly as this may be your problem.

Thank you, Ratslinger. Run directly has fixed it. The reference is also useful.