how to get decimal to date form

Поиск
Список
Период
Сортировка
От wireless200@yahoo.com (wireless)
Тема how to get decimal to date form
Дата
Msg-id 90446ee7.0309170450.2f16d9ef@posting.google.com
обсуждение исходный текст
Ответы Re: how to get decimal to date form
Список pgsql-sql
In our postgre database is a decimal field with format YYMMDDhhmmss.9999999999
where the 9s are random digits.  I'm trying to strip off just the
YYMMDD and put it in date form.

So far I came up with:
SUBSTR(TO_CHAR(rec_num,99999999999),1,6) AS Date which returns YMMDD.

For example where the rec_num is 30608124143.47069519725 the above
functions return 30608.

I tried wrapping another TO_CHAR around it to try to format it to a
date but this seems like it's a bit much for this purpose.

Any suggestions would be appreciated.

-David


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

Предыдущее
От: Kyle
Дата:
Сообщение: Trigger on view
Следующее
От: jaggybala@yahoo.com (Jagdeesh)
Дата:
Сообщение: Array fields in Postgresql...