Subject | Re: [firebird-support] Re: Formating date to yyyymmdd |
---|---|
Author | Mark Rotteveel |
Post date | 2009-06-12T13:12:14Z |
> selectI think using LPAD (and current_date) is a lot easier and readable:
> extract(year from cast('today' as date))
> || substring(cast(cast((100 + extract(month from cast('today' as date)))
> as integer) as varchar(100)) from 2 for 2)
> || substring(cast(cast((100 + extract(day from cast('today' as date)))
> as integer) as varchar(100)) from 2 for 2)
>
> from rdb$database
select extract(year from current_date) || lpad(extract(month from current_date), 2, '0') ...
(may require an additional cast to varchar, no access to Firebird here). I still think this is a presentation issue that should not be handled by the database.
--
GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und Telefonanschluss
für nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02