Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored Procedure Problem

Author  Topic 

jp2code
Posting Yak Master

175 Posts

Posted - 2008-07-22 : 09:52:08
I'm guessing this is something simple, but I just don't see it:

Here is the stored procedure:

CREATE PROCEDURE GetSystemIDs(@DateStart DateTime, @DateEnd DateTime) AS
SELECT DISTINCT System_ID FROM Company_Parts
WHERE (@DateStart <= Date_Time) AND (Date_Time <= @DateEnd)

Here is how I am trying to call it:

EXECUTE DataGrid_GetSystemIDs '6/30/2008' '7/22/2008'

Here is the error I get:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '7/22/2008'.

What did I do wrong?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-22 : 09:55:07
missing comma after the 1st parameter

EXECUTE DataGrid_GetSystemIDs '6/30/2008', '7/22/2008'



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jp2code
Posting Yak Master

175 Posts

Posted - 2008-07-22 : 09:58:55
Thanks! I've been a developer for years, but only just recently introduced to working with data on a server. New experience for me!

Thanks for catching my syntax error.
Go to Top of Page
   

- Advertisement -