• Here's an alternative:

    SELECT u.*, n.ID, n.notes

    FROM UserTable u

    INNER JOIN Notes n ON

    (u.lastaccounttype = 'account1' AND n.account1 = 1) OR

    (u.lastaccounttype = 'account2' AND n.account2 = 1) OR

    (u.lastaccounttype = 'account3' AND n.account3 = 1) OR

    (u.lastaccounttype = 'account4' AND n.account4 = 1) OR

    (u.lastaccounttype = 'account5' AND n.account5 = 1)

    Edit: Added the sql and /code tags around the SQL.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.