I'm creating a query which checks if a client made payments for a given month and if not set charges of 20% of the agreed monthly payment.

this is what i currently have:

SELECT 
    DAY(paydate) AS PayDay,
    clientid 
FROM 
    transactions,clients 
where 
    transactions.clientid=client.clientid 
    and transactions.product=invoices.product 
    and DAY(paydate)> 10 
order by 
    client.clientid

Thanks for your help

Currenty this is my code but how do i iterate through the month until the client finishes payments
$line4 = mysql_query("SELECT DAY(paydate) AS PayDay,clientid FROM transactions where transactions.clientid=client.clientid AND transactions.product=invoices.product AND DAY(transactions.paydate)> 10 and YEAR(transactions.paydate) = 2012 AND MONTH(transactions.paydate) = 3 AND transactions.balance > 0 order by client.clientid");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.