El Facha
El Facha

Reputation: 133

SQL Server function parameters

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

Answers (1)

Lucero
Lucero

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

Related Questions