Custom post status: Form query first and use sprintf for variable replacment before doing the actual query.