Hello,
I would like to sum each field where the record’s “Payment Card” field doesn’t contain particular text.
The “Payment Card” field might contain “cash,” “credit card,” or debit card," so I’d like to sum fields not containing “card.”
I’ve tried using NOT LIKE and similar, but can’t seem to figure out the syntax. Here is a working sum of each field, I just cant figure out where to specify the part of not summing records with “Payment Card” containing the word “card”:
SELECT YEAR( “Purchase Date” ) AS “Year”, SUM( “Face Value” ) AS “Total Face Value”, SUM( “Charge” ) AS “Total Charged”, SUM( “Charge” - ( IFNULL( “Extra GC”, 0 ) + IFNULL( “CB Earned”, 0 ) + IFNULL( “Offer Earned”, 0 ) ) ) AS “Total Cost” FROM “Transactions” GROUP BY YEAR( “Purchase Date” )
Thanks!