Q: How to convert int to date?
| От | Mattias Kregert |
|---|---|
| Тема | Q: How to convert int to date? |
| Дата | |
| Msg-id | 358F8585.4C6C5362@algonet.se обсуждение исходный текст |
| Ответы |
Re: [GENERAL] Q: How to convert int to date?
Re: [GENERAL] Q: How to convert int to date? Re: [GENERAL] Q: How to convert int to date? |
| Список | pgsql-general |
How do I convert INTEGER to DATE in 6.3.2? I have a table 'mytbl' with a column 'd' which is an integer, containing dates in YYMMDD form. Now, how do I convert these integer dates to date dates? I tried... ALTER TABLE mytbl ADD COLUMN dd date; UPDATE mytbl SET dd=date(d+1900); ...but there is no int-to-date function! UPDATE mytbl SET dd=((d+1900)::unknown)::date; ...does not work either. No int-to-unknown function! So, how do I cast to type unknown? I have ... let's see... around 500-600 days to solve this problem ;) /* m */
В списке pgsql-general по дате отправления: