1 Reply Latest reply on Jun 25, 2013 2:57 AM by DaveKraft

    How do you find out who did not contribute to a particular fund raiser that we all just did?

    College Kid

      Using MYsql How do you find out who did not contribute to a particular fund raiser that we all just did. There are many titles to the different charities that is under the othpaytitle of the Otherpay table,  I however just want to extract the non-contributors for a particular charity title. Is there anyway to do this? When I do the the syntax below it comes up as an "empty set". The search is done by way of the table Id matching and left joins. Please see below.

       

       

      SELECT  moiid, trim(concat(name.fname,' ' ,name.mname,' ',name.lname)) as Brother, name.moiid as Members_ID, sum(otherpay.othpayamt) as NO_Contribution, quadlt.ltfname as quad

       

      FROM name 

      LEFT JOIN OTHERPAY  ON name.moiid = otherpay.othpaymoiid

      LEFT JOIN quadlt  ON name.quadlt = quadlt.ltid

      WHERE  Otherpay.othpaytitle like '%food drive%'

      AND otherpay.othpaymoiid IS NULL

      AND name.type = 'BOI'

      AND name.type <> 'jrboi'

      AND name.city = 'SUFFOLK'

      GROUP BY brother

      ORDER BY name.quadlt, brother

        • 1. Re: How do you find out who did not contribute to a particular fund raiser that we all just did?
          DaveKraft Level 1

          Just guessing based on your query,  and assuming the above query works, just insert a "where" condition. I also removed the SUM function. Also, "AND otherpay.othpaymoiid IS NULL"  may not be needed.

           

          SELECT  moiid, trim(concat(name.fname,' ' ,name.mname,' ',name.lname)) as Brother, name.moiid as Members_ID, otherpay.othpayamt, quadlt.ltfname as quad

           

          FROM name 

          LEFT JOIN OTHERPAY  ON name.moiid = otherpay.othpaymoiid

          LEFT JOIN quadlt  ON name.quadlt = quadlt.ltid

          WHERE  Otherpay.othpaytitle like '%food drive%'

          AND otherpay.othpaymoiid IS NULL

          AND name.type = 'BOI'

          AND name.type <> 'jrboi'

          AND name.city = 'SUFFOLK'

           

          AND othpayamt=0

           

          ORDER BY name.quadlt, brother