• Publicidad

Obtener una fecha al restar x dias a 'now' (postgres)

Todo acerca de las bases de datos que existen: SQL, MySQL, Oracle, Postgres, CSV, etc.

Obtener una fecha al restar x dias a 'now' (postgres)

Notapor Daniel Jiménez » 2006-04-12 19:02 @834

Hola a todos,

tengo un problema con postgres y les agradeceré mucho su ayuda:

¿que debo hacer para indicar (en lugar de '2006-03-17') la fecha de hoy menos 30 días?

WHERE fecha_alta >= '2006-03-17'::date AND fecha_alta <= 'now'::text::date;

Gracias por su ayuda.
Daniel Jiménez
Perlero nuevo
Perlero nuevo
 
Mensajes: 2
Registrado: 2006-04-12 18:53 @828

Publicidad

Re: Obtener una fecha al restar x dias a 'now' (postgres)

Notapor explorer » 2006-04-13 04:29 @228

Para Perl, mira aquí:
viewtopic.php?t=652&highlight=fechas

Para PostgreSQL, mira aquí:
http://www.postgresql.org/docs/8.0/inte ... etime.html

Sería algo así como: current_date - integer '30'
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14476
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España

Notapor Daniel Jiménez » 2006-04-14 14:06 @629

Explorer, gracias a tu ayuda solucioné el problema.

Te lo agradezco.

Saludos.
Daniel Jiménez
Perlero nuevo
Perlero nuevo
 
Mensajes: 2
Registrado: 2006-04-12 18:53 @828


Volver a Bases de datos

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados

cron