Re: CALCULAR EDAD!

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CALCULAR EDAD!
Date: 2006-04-27 18:05:31
Message-ID: 20060427180531.GA26760@KanotixBox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

juan jose dominguez <preguntas_sql(at)hotmail(dot)com> schrieb:

> Buenas, queria saber como sacar la edad de alguien. Me da el siguiente error
> con el siguiente codigo :
> **** ---- FFuunnccttiioonn:: ffuunncciioonn__ssaaccaa__eeddaadd(()) ****
> **** DDRROOPP TTRRIIGGGGEERR ttrriiggggeerr__ssaaccaa__eeddaadd OONN ffeecchhaass;; ****
> **** DDRROOPP FFUUNNCCTTIIOONN ffuunncciioonn__ssaaccaa__eeddaadd (());; ****
> **** CCRREEAATTEE OORR RREEPPLLAACCEE FFUUNNCCTTIIOONN ffuunncciioonn__ssaaccaa__eeddaadd(()) RREETTUURRNNSS OOPPAAQQUUEE AASS''
> ****

Please, NO HTML!

> INSERT INTO fechas VALUES ('10/07/83');
> ERROR: invalid input syntax for type timestamp: "22 years 6 mons 20 days"
> CONTEXT: PL/pgSQL function "funcion_saca_edad" line 6 at assignment

The age() function returns not a timestamp, it returns a interval.

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vivek Khera 2006-04-27 18:53:06 Re: Vacuum suggesting doubling of max_fsm_pages
Previous Message juan jose dominguez 2006-04-27 17:56:41 CALCULAR EDAD!