|
-
Apr 7th, 2003, 01:32 PM
#1
Thread Starter
Lively Member
question about a sql server stored procedure
I wrote this and the syntax is fine however when i go to execute it in query analyzer it throws me and error about the '2/7/2003' Any ideas the column with the date is a datetime format
CREATE PROCEDURE dbo.TimesAccessed(@BeginDate datetime,@EndDate datetime) AS
SELECT UserName, location, AccessDate
FROM UserStats
WHERE (AccessDate > @BeginDate) AND (AccessDate <@EndDate )
GO
exec dbo.TimesAccessed('2/7/2003','2/15/2003')
"All those who wonder are not lost" -j.r.r tolkien
-
Apr 7th, 2003, 07:48 PM
#2
Get rid of the parenthesis, they are required when executing a literal string or variable, not when passing in parameters.
exec dbo.TimesAccessed '2/7/2003', '2/15/2003'
-
Apr 8th, 2003, 10:00 AM
#3
Thread Starter
Lively Member
"All those who wonder are not lost" -j.r.r tolkien
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|