Re: [SQL] date_part stored procs

2004-03-28 Thread Tsoloane Moahloli
Perfect. Thanks a lot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Lane Sent: 27 March 2004 01:03 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [SQL] date_part stored procs

Re: [SQL] date_part stored procs

2004-03-26 Thread Tom Lane
"Tsoloane Moahloli" <[EMAIL PROTECTED]> writes: > SELECT INTO len * FROM (SELECT > ((date_part(''year'',age(docDate))*12)+(date_part(''month'',age(docDate > AS a; > The problem is that it does not run and I cannot for the life of me tell > why. I think you miscounted parentheses.

[SQL] date_part stored procs

2004-03-26 Thread Tsoloane Moahloli
Title: Message Making me lose my cool.  Here is how it goes:   I have the following Stored Proc, Which I intend to find the age in months of a date...     CREATE FUNCTION interval_months(TIMESTAMP) RETURNS INTEGER AS ' DECLARE  docDate ALIAS FOR $1;  len INTEGER; BEGIN  SELECT INTO len * FR