• This function can certainly be converted into an inline table-valued function. It's tricky, but it can be done and it has nothing to do with parameters as the previous one used parameters as well.

    I wanted you to show what have you done even if it's incorrect to be sure that you're understanding what's going on and have some feedback of your progression. I could give you the fish, but I prefer to teach you how to fish. 😉

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2