Re: Nicht bezahlte Beiträge ermitteln
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
Subject
Views
Written By
Posted
3306
May 28, 2007 07:58AM
2288
May 28, 2007 11:40PM
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.