Subject | Re: [firebird-support] date function |
---|---|
Author | Bisma Jayadi |
Post date | 2004-10-04T04:09:01Z |
Thanks Helen... but the problem still persist...
than giving it up to the users. That's what computer is all about, right? :) I
hope the next minor version release (1.6?) will support DB2's date/time style
syntax. Believe me, it'll help us a lot. :)
I don't know why some of the syntaxes above raise an error. FYI, I use Firebird
1.5 on WindowsXP SP1 using dbExpress (Delphi 7). I believe the problem isn't
with the OS or the client application since other queries work fine.
It seems that predefined date literals are considered just like ordinary
internal database variables/constants, not as special identifiers that the
database would automagically understand what the user want from its position in
the query.
Oh, one more question... it seems that default udf (ib_udf and fbudf) is not
automatically included in the database. Am I right? Or did I do something wrong
in the installation? Because, I can't use ABS() without registering the udf.
For any kind of help, I thank you all in advanced.
-Bee-
has Bee.ography at:
http://beeography.modblog.com
> CURRENT_DATEThis works fine.
>
> insert into aTable (aDate)
> values (CURRENT_DATE)
> andBut, this doesn't. "Field name missing" error arise.
> SELECT CURRENT_DATE FROM RDB$DATABASE
> UPDATE aTableThis works fine too.
> set blah = CURRENT_DATE + 1
>
> DELETE from aTable
> where date between CURRENT_DATE - 30 and CURRENT_DATE - 15
> Operating with months isn't so simple - work out what you want and useAlright then. I know it's not so simple, but database engine should help rather
> either an expression or a UDF.
than giving it up to the users. That's what computer is all about, right? :) I
hope the next minor version release (1.6?) will support DB2's date/time style
syntax. Believe me, it'll help us a lot. :)
> SELECT CURRENT_DATE, FIELD_NAME FROM ATABLEThis doesn't work, same error as above.
> See also CURRENT_TIMESTAMP (to include time) and the predefined dateThis doesn't work.
> literals 'TODAY', 'TOMORROW', 'YESTERDAY' and 'NOW'. PDDLs have to be cast.
>
> So, these are the same:
>
> SELECT CURRENT_DATE + 1 FROM RDB$DATABASE
> andThis works.
> SELECT CAST('TOMORROW' AS DATE) FROM RDB$DATABASE
I don't know why some of the syntaxes above raise an error. FYI, I use Firebird
1.5 on WindowsXP SP1 using dbExpress (Delphi 7). I believe the problem isn't
with the OS or the client application since other queries work fine.
It seems that predefined date literals are considered just like ordinary
internal database variables/constants, not as special identifiers that the
database would automagically understand what the user want from its position in
the query.
Oh, one more question... it seems that default udf (ib_udf and fbudf) is not
automatically included in the database. Am I right? Or did I do something wrong
in the installation? Because, I can't use ABS() without registering the udf.
For any kind of help, I thank you all in advanced.
-Bee-
has Bee.ography at:
http://beeography.modblog.com