I have two tables. One which has a list of redeemed discount codes and discount amounts. The other with the discount code prefix as well as an associated a GL. I would like to group redeemed discount codes by SUM and GL but my issue is that discount codes can have random trailing characters (ie, CODE98392 with CODE being the prefix).
My thought here would be that I would need to create a join which utilizes a wildcard to just find a portion of the code. I created a sample db, the output in my query (Query1) should resemble:
DEMO -$55.00 - 123555555
DISC - $35.00 - 555666999
TEST - $60.00 - 12345678
Your help on this is appreciated.
Thank you,Click to view attachment