From: Martijn Tonies Date: December 7 2006 1:00pm Subject: Re: Function problem List-Archive: http://lists.mysql.com/mysql/203761 Message-Id: <018701c719ff$a9e0b7e0$9902a8c0@martijnws> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > Can somebody tells what's wrong with this fuction? I guess that depends on what it should do, wouldn't it? Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com > > > DELIMITER $$ > > > > DROP FUNCTION IF EXISTS `qbit`.`myprice_xondr`$$ > > > > CREATE FUNCTION `qbit`.`myprice_xondr`(x float(7,2)) RETURNS float(7,2) > > BEGIN > > CASE x > > WHEN x<50 THEN ceiling(x+x*0.25) > > when x>=50 AND x<100 then ceiling(x+x*0.20) > > when x>=100 AND x<150 then ceiling(x+x*0.15) > > when (x>=150 AND x<200) then (ceiling(x+x*0.10)) > > when (x>=200) then (ceiling(x+x*0.09)) > > end case; > > END$$ > > > > DELIMITER ; > > > > Thanx > > Nikos > > > >