Charles K. Clarkson wrote:

Lori <[EMAIL PROTECTED]> wrote:

: This is a postgresql question , slam me if you must, but
: this is the only list where I get a fast response and I
: know many of you use postgresql .... : : I have a int field called when_month and I want to use
: it to get the full month name something like :
: update mytable set myfield = date_part(month,'1/5/2004');
: the problem is date part returns 5 not May
: : If I wanted to do this in a program I could easily
: do it with an array ,but cant find quick way to do in
: postgresql ?????
: : I have looked it up on the postgresql site and on google
: but cant find a simple function that will do the trick


   I think you want the "to_char" or the "to_timestamp"
function. (Read the note.)

http://www.postgresql.org/docs/7/interactive/functions2976.htm



HTH,

Charles K. Clarkson


thanks charles, I have been playing with those 2 functions for the last hour or so, i
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 what I want but when I try to use a variable
update mytable set myfield=to_char('20040505','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


back to the drawing board
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to