Reputation: 133
I have a function that takes two parameters of type date like this
FUNCTION [dbo].[fn_Test] (@DiffFrom DATE, @DiffTo DATE)
RETURNS INT
but when I try to run
SELECT [fn_Test](convert(date, 'Oct 23 2012 11:01AM') , GETDATE())
I get the following error:
Incorrect syntax near the keyword 'convert'.
What am I doing wrong?
Upvotes: 0
Views: 100
Reputation: 60190
You need to qualify the function name like this:
SELECT [dbo].[fn_Test](convert(date, 'Oct 23 2012 11:01AM') , GETDATE())
Upvotes: 5