In the stored procedure 'PagedAnnouncementList' in your ClubSite Database you have to change the SQL statement from:
SELECT id, itemdate, title,
description, photo FROM Announcements
WHERE (itemdate > @keydate OR
(itemdate = @keydate) AND (id > @keyid)) ORDER BY itemdate ASC, id
ASC
To the following:
SELECT id, itemdate, title, description, photo FROM Announcements
WHERE (itemdate > @keydate OR
(itemdate = @keydate) AND (id > @keyid))
ORDER BY itemdate DESC, id DESC
But where do I find this. I have never worked with stored procedures before...
Have search for PagedAnnouncementList but the sql mentioned above does not appear.
So obviously I am missing something.
Go to management studio open the clubstarter kit database and go to stored procedures and look for the above stored proc it has to be there. And here is how you change it with the database open right click on it in the object browser and click on ALTER,
make the above changes to the last line relating to Order By and execute it in management studio. Hope this helps.
You are using the wrong tool, if you don't have it download SQL Server Express Advanced from the link below and you can use the management studio to do it. Hope this helps.
ken240
Member
125 Points
25 Posts
News Articles - How do U Sort most recent first
Sep 30, 2006 05:35 AM|LINK
Currently the news sort in ascending order.
Ken
mletsch
Member
35 Points
10 Posts
Re: News Articles - How do U Sort most recent first
Oct 02, 2006 07:00 PM|LINK
In the stored procedure 'PagedAnnouncementList' in your ClubSite Database you have to change the SQL statement from:
SELECT id, itemdate, title, description, photo FROM Announcements
WHERE (itemdate > @keydate OR
(itemdate = @keydate) AND (id > @keyid))
ORDER BY itemdate ASC, id ASC
To the following:
ken240
Member
125 Points
25 Posts
Re: News Articles - How do U Sort most recent first
Oct 02, 2006 10:25 PM|LINK
I figured it would be an order by clause.
But where do I find this. I have never worked with stored procedures before...
Have search for PagedAnnouncementList but the sql mentioned above does not appear.
So obviously I am missing something.
Caddre
All-Star
26581 Points
5308 Posts
Re: News Articles - How do U Sort most recent first
Oct 02, 2006 11:09 PM|LINK
Go to management studio open the clubstarter kit database and go to stored procedures and look for the above stored proc it has to be there. And here is how you change it with the database open right click on it in the object browser and click on ALTER, make the above changes to the last line relating to Order By and execute it in management studio. Hope this helps.
Gift Peddie
ken240
Member
125 Points
25 Posts
Re: News Articles - How do U Sort most recent first
Oct 03, 2006 07:17 AM|LINK
Awesome - Many thanks
I was not aware that this code was here. (newbie learning [:$])
From your info, I was able to modify the sql and pull the right info.
Caddre
All-Star
26581 Points
5308 Posts
Re: News Articles - How do U Sort most recent first
Oct 03, 2006 02:00 PM|LINK
Awesome - Many thanks
I was not aware that this code was here. (newbie learning [:$])
From your info, I was able to modify the sql and pull the right info.
I am glad I could be of help to you.
Gift Peddie
chriscee
Member
107 Points
59 Posts
Re: News Articles - How do U Sort most recent first
Oct 04, 2006 11:09 AM|LINK
Caddre
All-Star
26581 Points
5308 Posts
Re: News Articles - How do U Sort most recent first
Oct 04, 2006 11:23 AM|LINK
You are using the wrong tool, if you don't have it download SQL Server Express Advanced from the link below and you can use the management studio to do it. Hope this helps.
http://msdn.microsoft.com/vstudio/express/sql/compare/default.aspx
Gift Peddie