| От | Lori |
|---|---|
| Тема | help with to_date and to_char |
| Дата | |
| Msg-id | 416C74CC.6030309@dri.edu обсуждение исходный текст |
| Ответы |
Re: help with to_date and to_char
|
| Список | pgsql-sql |
Im trying to do something very simple
I have a field called when_month (integer )
so I want to get the month name for the integer
this comes close to what I want
update mytable set myfield=to_char(current_timestamp,'MON');
the result is myfield is set to OCT
which is close to what I want but when I try to use a variable
update mytable set myfield=to_char(when_month,'MON');
or a char with value of '05' or '5'
update mytable set myfield=to_char('05','MON');
get error:
update mytable set myfield=to_date(when_month,'MON');
update mytable set myfield=to_char('05','MON');
as well as
update mytable set full_month= to_date('01/'05'/2004','DDMONYYYY');
all get errors
Please can anyone help?
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера