Problem with to_date/to_char

Поиск
Список
Период
Сортировка
От Amin Schoeib
Тема Problem with to_date/to_char
Дата
Msg-id 70DD6153277512439CA4B66956A3098132D086@pdc.4tek-net.4tek.de
обсуждение исходный текст
Ответы Re: Problem with to_date/to_char  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-general

Hi,
Can somebody tell me why this query don't work when I use to_date
Instead of to_char

By using to_char:

select
 to_char(last_day(cast(current_date - interval '1 month' as date)),'DD.MM.YYYY')
 ;

Result:  31.08.2003

By using to_date:

select
 to_date(last_day(cast(current_date - interval '1 month' as date)),'DD.MM.YYYY')
 ;

Result:  01.23.0037

What can I do that this query works correctly with to_date?

Thanxx

Schoeib

4Tek Gesellschaft für angewandte Informationstechnologien mbH
Schoeib Amin
Tel.  +49 (0) 69 697688-132
Fax. +49 (0) 69 697688-111
http://www.4tek.de

В списке pgsql-general по дате отправления:

Предыдущее
От: CSN
Дата:
Сообщение: Pagination - 1 or 2 queries?
Следующее
От: Alex
Дата:
Сообщение: Views with Where Clauses