• Well, I have looked at the documentation but I can't make heads or tails of how a cross apply would work in this particular case. If you look at the first code snippet, you'll see how I'm using the results from the function - in the WHEN part of the CASE statement. Incidentally, the first field of my SELECT statement (t.HPROPERTY) is what I need to pass to the function, replacing the 553 hard coded in the function call.