| От | Tom Lane |
|---|---|
| Тема | Re: using between with dates |
| Дата | |
| Msg-id | 11098.1272550563@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | using between with dates (Geoffrey <lists@serioustechnology.com>) |
| Ответы |
Re: using between with dates
|
| Список | pgsql-general |
Geoffrey <lists@serioustechnology.com> writes:
> ship_date between '04/30/2010' AND '04/30/2010' + 14
> ERROR: invalid input syntax for integer: "04/30/2010"
> Can I use between with dates?
The problem with that is the parser has no reason to treat the strings
as dates, at least not till it comes to consider the BETWEEN
comparisons, which is too late to help in resolving the addition
in the subexpression (data types are determined bottom-up).
This'd work:
ship_date between '04/30/2010' AND '04/30/2010'::date + 14
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера