Re: Fechas - Dia de la semana

From: Julio Rivero <jcrmlima(at)gmail(dot)com>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>, Carlos Alberto Márquez Rey <carlos_marquez_rey(at)yahoo(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Fechas - Dia de la semana
Date: 2006-01-18 23:48:09
Message-ID: d34a12b60601181548m119fc1cfw953f7fc58dc795ce@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

yo he creado un query donde me saca el dia mes y año en español concatenado,
quizás pueda servir, aunque claro el query es engorroso... es cuestion de
gustos y de programador

select trim(case when to_char(current_date,'d') = '1' then 'DOMINGO'
when to_char(current_date,'d') = '2' then 'LUNES'
when to_char(current_date,'d') = '3' then 'MARTES'
when to_char(current_date,'d') = '4' then 'MIERCOLES'
when to_char(current_date,'d') = '5' then 'JUEVES'
when to_char(current_date,'d') = '6' then 'VIERNES'
when to_char(current_date,'d') = '7' then 'SABADO'
end)||' '|| to_char(current_date,'dd')||' '||trim(case when
to_char(current_date,'mm') = '01' then 'ENERO'
when to_char(current_date,'mm') = '02' then 'FEBRERO'
when to_char(current_date,'mm') = '03' then 'MARZO'
when to_char(current_date,'mm') = '04' then 'ABRIL'
when to_char(current_date,'mm') = '05' then 'MAYO'
when to_char(current_date,'mm') = '06' then 'JUNIO'
when to_char(current_date,'mm') = '07' then 'JULI0'
when to_char(current_date,'mm') = '08' then 'AGOSTO'
when to_char(current_date,'mm') = '09' then 'SETIEMBRE'
when to_char(current_date,'mm') = '10' then 'OCTUBRE'
when to_char(current_date,'mm') = '11' then 'NOVIEMBRE'
when to_char(current_date,'mm') = '12' then 'DICIEMBRE'
end)||' DEL '||trim(to_char(current_date,'yyyy'))

On 1/18/06, Jaime Casanova <systemguards(at)gmail(dot)com> wrote:
>
> On 1/18/06, Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx> wrote:
> > Jaime Casanova <systemguards(at)gmail(dot)com> writes:
> >
> > > select extract(dow from fecha) from tabla;
> >
> > Esto te regresa el número del día más no el nombre. Prueba con
> > to_char, ej:
> >
> > select to_char(now(), 'day');
> >
> > Actualmente únicamente regresa los nombres en inglés, usa el prefijo
> > fm si no quieres que te ponga espacios alrededor, ej 'fmday'.
> >
> > Saludos,
> > Manuel.
> >
>
> pero si usa extract(dow puede hacer una funcion y regresar los
> nombres en español
>
> --
> Atentamente,
> Jaime Casanova
> (DBA: DataBase Aniquilator ;)
>
> ---------------------------(fin del mensaje)---------------------------
> TIP 5: ¿Has leído nuestro extenso FAQ?
>
> http://www.postgresql.org/files/documentation/faqs/FAQ.html
>

--

Saludos
Att,
Julio Rivero
Movil: 98817321

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Raul Caso 2006-01-19 00:06:56 Re: FUNCION QUE RETORNA UNA TABLA
Previous Message Miguel Angel 2006-01-18 23:46:45 Herramienta