| От | Mattias Kregert |
|---|---|
| Тема | Re: [GENERAL] Q: How to convert int to date? |
| Дата | |
| Msg-id | 3590AF91.17266A08@algonet.se обсуждение исходный текст |
| Ответ на | Re: [GENERAL] Q: How to convert int to date? (Patrice Hédé <patrice@idf.net>) |
| Список | pgsql-general |
Patrice Hédé wrote: > > Forget my first reply, there is no date(text) function either... Yes, I know. I thought pg would automagically cast to 'unknown' when it could not find a valid conversion, and then try again. Perhaps that could solve many problems. > > But you can do that : > > test=> select test, (test+19000000)::text::datetime::date from testint; > test| date > ------+---------- > 980101|01-01-1998 > 971121|21-11-1997 > 720306|06-03-1972 > (3 rows) > > The test field is a int4 field, so you can do that (not very nice, but it > works) :) > > Hope this helps ! Yes! It does. This is exactly what I want! Thank you! /* m */
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера