stocktondesigns
Technical User
I have a press release section on our web site, I show current press as the current year. I would like to have a query that returns press releases older than 1 year, but am having difficulty creating the view in SQL.
I have created a similar query for the current year:
SELECT TOP 100 PERCENT *
FROM dbo.pressreleases
WHERE (DATEPART(yy, ReleaseDate) = DATEPART(yy, GETDATE()))
Would appreciate help on how to modify this, or prepare the SQL that would derive press releases older than 365 days.
I have created a similar query for the current year:
SELECT TOP 100 PERCENT *
FROM dbo.pressreleases
WHERE (DATEPART(yy, ReleaseDate) = DATEPART(yy, GETDATE()))
Would appreciate help on how to modify this, or prepare the SQL that would derive press releases older than 365 days.