• Thanks   I've got a query that returns the data I require:

    SELECT OPCQuality,
      FROM Live
      WHERE TagName IN ('Work-Shop-Email-Test')

    So now your saying I need to create a variable to hold the data (OPCQuality) and then test that variable with an if statement sounds easy any chance of a quick example?