On Sep 2, 2015, at 11:02 PM, Ethan Rosenberg <erosenberg@xxxxxxxxxxxxxxxxxxxx> wrote: > Dear list - > > I know that I am making a mistake somewhere. but am lost for an answer. > > mysql> select Payments from Charges where if(Payments, Payments, 0); > +----------+ > | Payments | > +----------+ > | 13.00 | > | 55.00 | > | 65.00 | > | 65.00 | > | 65.00 | > | 65.00 | > | 123.00 | > | 150.00 | > > mysql> select Balance, Payments, Charges from Charges where ifnull(Balance,0); > +---------+----------+---------+ > | Balance | Payments | Charges | > +---------+----------+---------+ > | -13.00 | 13.00 | 0.00 | > | 123.00 | 0.00 | 123.00 | > | 325.00 | 0.00 | 325.00 | > | 10.00 | 0.00 | 23.00 | > | 270.00 | 55.00 | 0.00 | > | 58.00 | 65.00 | 0.00 | > | -7.00 | 65.00 | 0.00 | > | -72.00 | 65.00 | 0.00 | > > TIA > > Ethan Something like? $SQL = "SELECT * FROM `Charges` WHERE Cust_Num=".$Cust_Num." AND Charges!='NULL' AND Ballance!='NULL' AND Payments!='NULL' ORDER BY Date ASC"; Not sure why you would have a column name the same as your database table though. Could get confusing. HTH, Best, Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php