need to show the data in date month and year wise in sql server [Resolved]

Posted by Selvimca under Sql Server on 4/30/2015 | Points: 10 | Views : 344 | Status : [Member] | Replies : 2
this is ,my query


select *, convert(varchar(20), convert(varchar(2), day(date))+' ' +convert(varchar(3), datename(month, date))+' ' +convert(varchar(4), year(date))) as dat1 from partypaymentdetails
order by sectionname, month(date) ,day(date)


but it show the output like this



24/01/2015
22/01/2014

i need if 2014 details 1st then 2015 details next




Responses

Posted by: Bandi on: 4/30/2015 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
may be this ?

order by sectionname, YEAR(date) desc , month(date) ,day(date) 



Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Selvimca, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Selvimca on: 5/2/2015 [Member] Starter | Points: 25

Up
0
Down
thanks for your reply sir



Selvimca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response