21.10.2013 Views

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Available in: DSQL, PSQL<br />

Added in: <strong>2.1</strong><br />

Internal functions<br />

DATEADD()<br />

Description: Adds the specified number of years, months, days, hours, minutes, seconds or milliseconds to a<br />

date/time value.<br />

Result type: DATE, TIME or TIMESTAMP<br />

Syntax:<br />

DATEADD ()<br />

::= TO <br />

| , , <br />

::= an integer expression (negative to subtract)<br />

::= YEAR | MONTH | DAY<br />

| HOUR | MINUTE | SECOND | MILLISECOND<br />

::= a DATE, TIME or TIMESTAMP expression<br />

Examples:<br />

• The result type is determined by the third argument.<br />

• With DATE arguments, only YEAR, MONTH and DAY can be used.<br />

• With TIME arguments, only HOUR, MINUTE, SECOND and MILLISECOND can be used.<br />

dateadd (28 day to current_date)<br />

dateadd (-6 hour to current_time)<br />

dateadd (month, 9, DateOfConception)<br />

dateadd (minute, 90, time 'now')<br />

dateadd (? year to date '11-Sep-1973')<br />

Available in: DSQL, PSQL<br />

Added in: <strong>2.1</strong><br />

DATEDIFF()<br />

Description: Returns the number of years, months, days, hours, minutes, seconds or milliseconds elapsed between<br />

two date/time values.<br />

Result type: BIGINT<br />

Syntax:<br />

DATEDIFF ()<br />

135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!