| 
	
 | 
 Posted by Bob Bedford on 04/25/06 23:07 
Thanks for replying, Andy, 
 
I've no access to any mysql newsgroup with my ISP, that's why I ask here. 
 
Here is my query: 
 
SELECT person.IDProprietary, FirstName, LastName,  
DATE_FORMAT(StartDate,'%Y-%m-%d') as Datestartabo, abos.IDAbo,  
billpro.IDBill, DateBill, AmountBill, SUM(paymentpro.AmountPayment) as  
totalpayment from person inner join abos on person.IDProprietary =  
abos.IDProprietary inner join typevendeur on person.IDTypeVendeur =  
typevendeur.IDTypeVendeur left join billpro on abos.IDAbo = billpro.IDAbo  
left join paymentpro on billpro.IDBill = paymentpro.IDBill WHERE  
typevendeur.IDTypeVendeur > 1 group by paymentpro.IDPayment HAVING  
AmountBill > totalpayment ORDER BY FirstName 
 
the problem is that I've no result with "having AmountBill > totalpayment"  
as there is no payment at all (I guess). 
 
I'd like to have all records where the totalpayment < AmountBill but can't  
figure out how. What's wrong with my query ? 
 
Bob
 
  
Navigation:
[Reply to this message] 
 |