-
May 28th, 2007, 01:13 AM
#1
Incorrect use of dateadd() function
Hi guys,
I have a stored procedure which has a datetime parameter. But when I call it like this:
exec spSomething dateadd(minute, 30, getutcdate())
It complains as "Incorrect syntax near 'minute'.
But when I call it like this:
declare @time datetime
set @time = dateadd(minute, 30, getutcdate())
exec spSomething @time
Everthing is OK. Why? Can you help me on this?
Thank you !
-
May 29th, 2007, 05:13 AM
#2
Re: Incorrect use of dateadd() function
exec spSomething(dateadd(minute, 30, getutcdate()))
?
-
June 6th, 2007, 05:37 AM
#3
Re: Incorrect use of dateadd() function
all sp's expects the parameter while they do not perform any arithmetic on parameter and generate the value for their parameter.
Whenever I hear "It can't be done", I know, I am close to success!!
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
|