• You need to change your WHERE clause to something like this:

    WHERE

    d.VendorRelationStatus = ’On Hold’

    AND d.ContractEndDate > getdate()

    OR (d.VendorRelationStatus = 'Active'

    AND d.ContractEndDate >= dateadd(d, +360, getdate())

    )

    This WHERE clause now says, "Give me all On Hold Vendors whose contract end date is after today OR Active Vendors whose Contract End Date is more than 360 days from today."

    Another way to write this that may perform better in is to write 2 selects (1 that returns the On Hold vendors and 1 that returns the active vendors) and then use a UNION ALL to return them in one result set. This can perform better than an OR because the OR will often cause an index scan while the UNION ALL can do 2 index seeks. This isn't always faster, but can be. You need to test.

    If you take a look at the top link in my signature and post questions using the suggestions in that article you'll have a better chance of getting solution that will work the first time.