Changed db query to look for the last GOOD run in dqm