Subject Re: [firebird-support] Re: Formating date to yyyymmdd
Author Mark Rotteveel
Michel Veerman wrote:
>> I think using LPAD (and current_date) is a lot easier and readable:
>>
>> select extract(year from current_date) || lpad(extract(month from
> current_date), 2, '0') ...

> True, but it's an UDF. Not that it should matter much, but some people
> are allergic to them :-).

In 2.1 it is a built-in function, not an UDF. But even if you are on 2.0
or earlier, current_date looks cleaner than cast('today' as date).

> Sometimes it's simply easier and quicker to do it all in one SQL script.
> Especially when it's a do-it-once-and-then-throw-away-the-code program
> :-).

> But for a full blown program, I agree with you.

True, I myself am guilty of it as well sometimes when I am querying
testdata or checking test results.

Mark

--
Mark Rotteveel