Can anyone tell me why this always return 1?  Thanks!

CREATE FUNCTION passrate(date, date, text) RETURNS float AS '

DECLARE
 begindate ALIAS FOR $1;
 enddate ALIAS FOR $2;
 passfail ALIAS FOR $3; 
 ret float;
 countp float;
 counttotal float;
 

BEGIN

 SELECT INTO countp COUNT(*)
 FROM benchmark
 WHERE passfail = passfail;

 SELECT INTO counttotal COUNT(*)
 FROM benchmark;

 ret := countp / counttotal;
 RETURN ret;
END;'
LANGUAGE 'plpgsql';


John


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to