Re: Zero Values
| From: | Karl DeSaulniers | Date: | Thu, 03 Sep 2015 05:46:17 +0000 |
| Subject: | Re: Zero Values | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-49067@lists.php.net to get a copy of this message | ||
On Sep 2, 2015, at 11:02 PM, Ethan Rosenberg <erosenberg@hygeiabiomedical.com> 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