Subject | RE: [firebird-support] Re: Formating date to yyyymmdd |
---|---|
Author | Michel Veerman |
Post date | 2009-06-12T13:10:31Z |
>>EXTRACT(MONTH FROM BirthDate) || EXTRACT(DAY FROM BirthDate)
>> Using Firebird 2.0, how can I format a date to yyyymmdd?
>>
>> For example Jan 15 2009 -> 20090115
>>
>> My first approach has been using EXTRACT(YEAR FROM BirthDate) ||
>> but it does not work for me because I need to lead zeros and I cannotfind how do it. Maybe there is a direct function.
>>date))) as integer) as varchar(100)) from 2 for 2)
>> Thanks
>>
>select
>extract(year from cast('today' as date))
>|| substring(cast(cast((100 + extract(month from cast('today' as
>|| substring(cast(cast((100 + extract(day from cast('today' as date)))as integer) as varchar(100)) from 2 for 2)
>Varchar(100) is a bit large for 3 digits, itsn't it :-).
>from rdb$database
Kind regards,
Michel Veerman
[Non-text portions of this message have been removed]