Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    3

    Unanswered: List customers who have a balance due.

    Hi All,
    I would greatly appreciate any clarity regarding the following:
    I am encountering syntax errors with the code:

    mysql> Select CONCAT( FName, ' ', LName ) AS "Customer Name",
    TourName AS "Tour Name", TourStartDate AS "Start Date", Cost AS "Tour Cost",
    SUM(PaymentAmt) AS "Amount Paid", ( Cost - SUM(PaymentAmt) ) AS "Amount Due"
    FROM Customers INNER JOIN Tours INNER JOIN Payments
    WHERE NOT EXISTS
    ( Select Cost FROM Tours
    WHERE ( Cost - SUM(PaymentAmt <= 0 ));
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near '' at
    line 1
    mysql>
    Thanks,

    Michael Barry

  2. #2
    Join Date
    Mar 2004
    Posts
    480

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •