I finally found a solution with a combination of both answers from Brenden and Rui. I kept putting my field name equal to 'Yes' but it wouldn't work and it would result in an error. Brenden made me realize that the reason why is because I was selecting multiple page types in my web part. I changed this to only select one and the WHERE condition works now.
Thanks everyone who helped out!