Reputation: 7325
Is it possible to do this
SELECT *
FROM xcu
JOIN fun_Blocked_Dates('2011-01-01', '2012-01-01', xcu.uid) bd ON bd.uid = xcu.uid
It seems that function Blocked_Dates is unable to accept xcu.uid as a valid parameter.
I get an error "Incorrect syntax near 'xcu'."
Upvotes: 10
Views: 26540
Reputation: 138960
Perhaps this will work for you.
SELECT *
FROM xcu
CROSS APPLY fun_Blocked_Dates('2011-01-01', '2012-01-01', xcu.uid)
You can't use fields from tables as parameters to a function in a join. You need to use cross apply.
Upvotes: 25