0

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?

1
  • 2
    How can we debug your function if you haven't posted it -_- Commented Oct 19, 2016 at 23:18

1 Answer 1

5

You need to qualify the function name like this:

SELECT [dbo].[fn_Test](convert(date, 'Oct 23 2012 11:01AM') ,  GETDATE()) 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.