| От | Joel Burton |
|---|---|
| Тема | Re: substring .. |
| Дата | |
| Msg-id | 200012192008.eBJK8E322196@olympus.scw.org обсуждение исходный текст |
| Ответ на | substring .. (Jeff MacDonald <jeff@hub.org>) |
| Список | pgsql-sql |
> i want to do this to a datetime field.. > > select foo from table where substr(datefoo,1,11) = '2000-12-14'; > > it returns no results yet.. > > select substr(datefoo,1,11) does return some values that say > 2000-12-14 Ummm... because '2000-12-14' is a ten-character, not eleven character long string. Try substr(datefoo,1,10) and it works for me (under 7.1devel). However, this all seems sloppy. Why not extract the date, and compare it as a date? -- Joel Burton, Director of Information Systems -*- jburton@scw.org Support Center of Washington (www.scw.org)
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера