Ask Your Question
0

firebird functions

asked 2018-10-02 18:17:42 +0100

Pansmanser gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2018-10-02 18:50:52 +0100

Ratslinger gravatar image

updated 2018-10-02 18:51:55 +0100

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.

edit flag offensive delete link more

Comments

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

Pansmanser gravatar imagePansmanser ( 2018-10-02 22:38:15 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-10-02 18:17:42 +0100

Seen: 90 times

Last updated: Oct 02 '18