L
Lloyd Dupont
I have a blog_text table with a date column.
I'm trying to write a stored which find the month ot the last entry, and the
return all records for the month.
I'm quite new to stored procedure, can't find relevant infomation in the
documentation, and I'm not managing it....
If anyonw could gives me any hinth on why the below code is wrong and how to
make it both
- compile
- return last month entries...
thanks ;-)
---------
CREATE PROCEDURE dbo.LastBlogMonth AS
DECLARE @max_date DATETIME
SELECT @max_date = MAX([date]) FROM galador_blog_text
GO
SELECT * FROM galador_blog_text
WHERE [date] >= @max_date
RETURN
GO
I'm trying to write a stored which find the month ot the last entry, and the
return all records for the month.
I'm quite new to stored procedure, can't find relevant infomation in the
documentation, and I'm not managing it....
If anyonw could gives me any hinth on why the below code is wrong and how to
make it both
- compile
- return last month entries...
thanks ;-)
---------
CREATE PROCEDURE dbo.LastBlogMonth AS
DECLARE @max_date DATETIME
SELECT @max_date = MAX([date]) FROM galador_blog_text
GO
SELECT * FROM galador_blog_text
WHERE [date] >= @max_date
RETURN
GO