Click here to Skip to main content
15,905,587 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: [newbie] Controls have to be aligned Pin
Member 400159616-Jan-09 22:34
Member 400159616-Jan-09 22:34 
GeneralRe: [newbie] Controls have to be aligned [modified] Pin
jon-8018-Jan-09 8:28
professionaljon-8018-Jan-09 8:28 
QuestionAjax Update Pannel Pin
Member 400159616-Jan-09 1:55
Member 400159616-Jan-09 1:55 
AnswerRe: Ajax Update Pannel Pin
Paddy Boyd16-Jan-09 2:46
Paddy Boyd16-Jan-09 2:46 
AnswerRe: Ajax Update Pannel Pin
Abhijit Jana16-Jan-09 4:03
professionalAbhijit Jana16-Jan-09 4:03 
GeneralRe: Ajax Update Pannel Pin
Member 400159616-Jan-09 22:31
Member 400159616-Jan-09 22:31 
Questionsql ouery problem Pin
pragya_chaubisa16-Jan-09 1:20
pragya_chaubisa16-Jan-09 1:20 
AnswerRe: sql ouery problem Pin
Ashfield16-Jan-09 2:32
Ashfield16-Jan-09 2:32 
I've not tried it, but something like this should do it:

SELECT a.topic_id, a.group_id, a.cat_id, a.username, a.topic_title, a.topic_msg, a.topic_create_date, a.no_of_views, a.no_of_reply, a.is_sticky, 
a.is_closed, case when a.is_sticky = 'Y' then getdate() else coalesce(b.rply_date,a.topic_create_date) end as SortDate
FROM create_topic AS a Outer JOIN
reply_topic AS b ON a.group_id = b.group_id AND a.cat_id = b.cat_id AND a.topic_create_date = b.rply_date
Order by SortDate desc



The idea is, when the topis is sticky then use getdate, else use the reply date (if there is one, else topic create date) and order by sort date desc.

This should give you all the topics , sticky first followed by the most recent replies/postings

As I said, I have not tested it, but it should be somewhere on the lines you need.

Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP

GeneralRe: sql ouery problem Pin
pragya_chaubisa19-Jan-09 0:53
pragya_chaubisa19-Jan-09 0:53 
GeneralRe: sql ouery problem Pin
Ashfield19-Jan-09 8:53
Ashfield19-Jan-09 8:53 
Questiongrid view display Pin
varsh1216-Jan-09 0:49
varsh1216-Jan-09 0:49 
AnswerRe: grid view display Pin
Jon Rista16-Jan-09 12:21
Jon Rista16-Jan-09 12:21 
Questionhow to remove dll reference in visual studio? Pin
mr_muskurahat16-Jan-09 0:44
mr_muskurahat16-Jan-09 0:44 
AnswerRe: how to remove dll reference in visual studio? Pin
Abhijit Jana16-Jan-09 20:55
professionalAbhijit Jana16-Jan-09 20:55 
Questionmerge two pdf Pin
bhaumikdv16-Jan-09 0:11
bhaumikdv16-Jan-09 0:11 
AnswerRe: merge two pdf Pin
SeMartens16-Jan-09 3:45
SeMartens16-Jan-09 3:45 
Question[Message Deleted] Pin
mihirkul15-Jan-09 23:33
mihirkul15-Jan-09 23:33 
AnswerCP IGNORE; repost Pin
leckey16-Jan-09 4:21
leckey16-Jan-09 4:21 
QuestionDatagrid with row movement by mouse clicking Pin
Girish48115-Jan-09 23:12
Girish48115-Jan-09 23:12 
AnswerRe: Datagrid with row movement by mouse clicking Pin
Ashfield16-Jan-09 1:28
Ashfield16-Jan-09 1:28 
QuestionCheckbox in datagrid! Pin
RajpootRohan15-Jan-09 22:37
professionalRajpootRohan15-Jan-09 22:37 
AnswerRe: Checkbox in datagrid! Pin
Christian Graus15-Jan-09 23:26
protectorChristian Graus15-Jan-09 23:26 
AnswerRe: Checkbox in datagrid! Pin
Herman<T>.Instance19-Jan-09 3:34
Herman<T>.Instance19-Jan-09 3:34 
QuestionHow to get a particular sub report of any report programaticaly ? Pin
bhaumikdv15-Jan-09 22:20
bhaumikdv15-Jan-09 22:20 
GeneralMVP implementation questions Pin
Nathan Gloyn15-Jan-09 21:59
Nathan Gloyn15-Jan-09 21:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.