Re: day interval

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: day interval
Дата
Msg-id 87mue5x60l.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на RE: Re: day interval  ("Abraham, Danny" <danny_abraham@bmc.com>)
Ответы RE: Re: day interval  ("Abraham, Danny" <danny_abraham@bmc.com>)
Список pgsql-general
>>>>> "Abraham" == Abraham, Danny <danny_abraham@bmc.com> writes:

 Abraham> The problematic code is:
 Abraham> select date(cm_curr_date) - date(CM_DATE) into diff_days from CMS_SYSPRM;

This will always return an integer, unless either the date() cast or the
-(date,date) operator have been redefined or modified.

 Abraham> The fix is:
 Abraham> select date_part ('day', age( date(cm_curr_date), date(CM_DATE))) into diff_days from CMS_SYSPRM;

This doesn't do the same thing, it will give a different result if the
dates differ by a month or more.

 Abraham> The problem:
 Abraham> How to recreate the problem.  (You know - QA).

 Abraham> Tried changing lc_time, timezone and datestyle .. but nothing
 Abraham> seems to work

None of these things can affect data types.

-- 
Andrew (irc:RhodiumToad)



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

Предыдущее
От: "Abraham, Danny"
Дата:
Сообщение: RE: Re: day interval
Следующее
От: "Abraham, Danny"
Дата:
Сообщение: RE: Re: day interval