Re: [SQL] dates in functions

2001-03-05 Thread George Moga
Salvador Mainé wrote: > Hello: > > I'm trying to define a function that, given a date, returns its month. > The definition is as follows: > > CREATE function anyo_hidro (date) returns int AS ' >BEGIN >RETURN date_part("month",$1); >END; > ' LANGUAGE 'plpgsql'; > > But when

[SQL] dates in functions

2001-03-02 Thread Salvador Mainé
Hello: I'm trying to define a function that, given a date, returns its month. The definition is as follows: CREATE function anyo_hidro (date) returns int AS ' BEGIN RETURN date_part("month",$1); END; ' LANGUAGE 'plpgsql'; But when I do: select anyo_hidro('1-1-1999'); I g