Subject | RE: [firebird-support] fb book error? |
---|---|
Author | Thomas Ellis |
Post date | 2007-09-24T17:32:04Z |
It's actually quite interesting that the range is 0-365 since all the other
day of year functions I know return 1-366.
.NET
DateTime.DayOfYear
Borland
DayOfTheYear
Oracle
SELECT {fn DAYOFYEAR('2007-01-01')} FROM DUAL;
MS-SQL
SELECT DATEPART( "dayofyear", '01 JAN 2007' );
MySQL
DAYOFYEAR(date)
DB2
EXTRACT(DAYOFYEAR FROM '01 JAN 2007')
PostgreSQL
SELECT EXTRACT(DOY FROM TIMESTAMP '2007-01-01');
SmallSQL
DAYOFYEAR(date)
More interestingly though is that the SQL:2003 standard's definition does
not specifically state the values for days only months (which must be 0-11).
Which means that Firebird's implementation although it goes against the
grain falls in line with the standard precedent set for "MONTH".
Sorry useless bit of reading for any interested.
Cheers
Thomas Ellis
day of year functions I know return 1-366.
.NET
DateTime.DayOfYear
Borland
DayOfTheYear
Oracle
SELECT {fn DAYOFYEAR('2007-01-01')} FROM DUAL;
MS-SQL
SELECT DATEPART( "dayofyear", '01 JAN 2007' );
MySQL
DAYOFYEAR(date)
DB2
EXTRACT(DAYOFYEAR FROM '01 JAN 2007')
PostgreSQL
SELECT EXTRACT(DOY FROM TIMESTAMP '2007-01-01');
SmallSQL
DAYOFYEAR(date)
More interestingly though is that the SQL:2003 standard's definition does
not specifically state the values for days only months (which must be 0-11).
Which means that Firebird's implementation although it goes against the
grain falls in line with the standard precedent set for "MONTH".
Sorry useless bit of reading for any interested.
Cheers
Thomas Ellis