Executing Stored Procedure with date parameter
Posted on 2006-05-02
I have written SP as:
Create PROCEDURE sp_rptBirthDayList(@strPredicate As Varchar(7500),@strOrderBy as varchar(1000),@StartDate as datetime,@EndDate as datetime)
Now I want to run this SP through Query Analyzer and I do it as:
sp_rptBirthDayList '', ' Passengers.LastName ', Convert(datetime,'20/12/2005', 103), Convert(datetime,'09/01/2006',103)
This gives me error:
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'Convert'.
I have many such SPs that take date as parameter. They run well through my .NET application. But when we try to run them through Query Analyzer, we always get this error. How do I pass date parameter?