Thanks. I have that and this select hypathetically returns a code that I want to then say select value from table where (if not not exist .. etc) -< this returns a code I want to use in a where. This does not work.
A value I was to use in a where exists in 1 of two places (table). I need to check if it exists in table 1 use it otherwise check place 2 where it's guaranteed to be. The value returned from this I need to pass to a where clause. Has to be within a select statement and not transact sql.