Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2010

    Unanswered: Need alot of help with this query

    I have a entertainment company that has dj bookings, equipment bookings and bouncy castle bookings
    I want to write a query to find out how much an employee has made of the years

    in the table attached Ian is both a employee and a customer
    I want to find out how much Ian has made as an employee only so exclude payments whe from = ian to = me and reason != Commision

    When working out the calcuations manually I get these amounts
    For 2014 Ian has made 200 for booking id #1
    For 2015 Ian has made 70 ( -20 for paying me commision (id #2) + 10 (id #4) +80 (id #6))
    For all years he has made 270

    can some body write a mySQL query to find the sum of money paid by an employee for all years and for 2014 and 2015
    Attached Thumbnails Attached Thumbnails query.jpg  

Posting Permissions

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