From: hsv Date: February 3 2013 12:59am Subject: Re: Complex MySQL Select Statement Help List-Archive: http://lists.mysql.com/mysql/228903 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" >>>> 2013/02/02 12:58 -0600, Peter Brawley >>>> On 2013-02-01 10:18 PM, hsv@stripped wrote: >>>>>2013/01/31 22:24 -0600, Peter Brawley >>>> >Is this what you mean? > >Select, >pricelist >If( !IsNull(specialprice) And specialprice < unitprice And CurDate() Between startingDate And endingDate, >specialprice, >unitprice >) as used_price >>From catalog >Where itemid='WB314'; > >PB ><<<<<<<< >Maybe this is gilding the lily, but if "specialprice" is null, then >specialprice < unitprice >is not true Read again: ...If( !IsNull( specialprice )... <<<<<<<< Right: if specialprice < unitprice is true, then "specialprice" is not null. The null-test is absorbed.