MySQL Forums
Forum List  »  German

Re: Nicht bezahlte Beiträge ermitteln
Posted by: daniel bihler
Date: May 29, 2007 01:21AM

Hi Hauke
Danke erstmal für die Antwort.
Funktioniert soweit einwandfrei.Den Dummy brauch ich nicht da ich ja kein Datum ausgeben muß wenn noch nie was einbezahlt wurde.
Die Query sieht nun so aus:

"SELECT CONCAT_WS(' - zuletzt bezahlt am - ', CONCAT_WS(' ', client.nname, client.vname), DATE_FORMAT(date, '%d.%m.%Y')) FROM bookings AS book, clients AS client WHERE book.date <= DATE_SUB( CURDATE(), INTERVAL 12 MONTH) AND book.client_id = client.id
UNION
SELECT CONCAT_WS(' ', CONCAT_WS(' ', cl.nname, cl.vname), ' noch keine Einzahlungen') FROM clients as cl LEFT JOIN bookings as bo on bo.client_id = cl.id
WHERE bo.client_id IS NULL

Vielen Dank Dir für die passende Lösung

Daniel

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Nicht bezahlte Beiträge ermitteln
2409
May 29, 2007 01:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.