Re: Complex MySQL Select Statement Help

2013-02-02 Thread hsv
 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--and maybe if the null-test is left out it is less clear 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Complex MySQL Select Statement Help

2013-02-02 Thread Peter Brawley

On 2013-02-01 10:18 PM, h...@tbbs.net 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 )...

PB

--and maybe if the null-test is left out it is less clear





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql