Subject | Re: Date problem in Firebird |
---|---|
Author | Adam |
Post date | 2005-06-12T02:37:29Z |
> My another doubt is is any UDF available in firebird similar toYou do not need to have an external library to convert from one data
> Oracle's to_char()
type to another. You can use the Cast method.
eg.
Cast(FieldName as Varchar(10))
or
Cast(FieldName as Integer)
etc
Obviously, you can not do
Cast('a' as Integer), so you have to be able to fit the data you are
passing in into the type of field you are casting it as.
Now as to your previous problem, there is nothing stopping you from
using
Cast(dt_start as Varchar(10)), but you do not get any choice about
how you want it formatted. The best advice is to retrieve the
information as a date variable, and if you want it formatted a
particular way then do if from within your library. Writing a UDF is
a work around IMO, and I doubt anyone will have done one for this
purpose, so it is a case of doing some reading on UDFs if you really
want to do it that way.