There is no need to declare a variable and assign a value to it. Just return the select statement.
ALTER PROCEDURE [dbo].[get](@i int) AS BEGIN select ADate from table where i=@i and DateDiff(day ,getDate(), aDate ) > 0 and aDate is not null order by aDate asc END
Although you should be aware that depending on your data this may return more than one value.
EDIT
If you want you can do it like this:
ALTER PROCEDURE [dbo].[get](@i int, @date datetime output) AS BEGIN select @date = ADate from table where i=@i and DateDiff(day ,getDate(), aDate ) > 0 and aDate is not null order by aDate asc END
And then you can use it like this:
Declare @res datetime exec get 3, @res print @res
source share