Since it's a function, it looks like you are missing something.
See the details about the error here: http://www.sql-server-performance.com/2007/parameters-not-supplied-is/
This error message appears when you don’t supply a value expected by a user-defined function.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. You must supply values for each parameter in a user-defind function as long as there is not default value for that parameter defined. These supplied values must explicitly or implicitly be convertible to the parameter in question.