Couldn’t execute stored proc. in date diff
SELECT DATEDIFF(DAY,'2012-11-23',(exec AddValorDate 3,'2012-11-26'))
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'exec'.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ')'.
The following will solve your problem if you cannot convert the stored procedure to a function.
declare @date table
(
theDate datetime
)
insert into @date
exec AddValorDate 3,’2012-11-26′
SELECT DATEDIFF(DAY,’2012-11-23′,theDate) from @date