need to change the month format in sql server [Resolved]

Posted by Selvimca under Sql Server on 5/2/2015 | Points: 10 | Views : 547 | Status : [Member] | Replies : 1
select partyid, convert(varchar(20), convert(varchar(2), day(date))+' '
+convert(varchar(10), datename(month, date))+' ' +convert(varchar(4), year(date)))
as dat1 from partypaymentdetails where sectionname='Owner'
and partyname='celv' order by sectionname, YEAR(date) asc , month(date) ,day(date)
am getting output like this





20/jan/2015





but my need is 20/01/2015




Responses

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

Up
0
Down

Resolved
select partyid
,convert(varchar, date, 103) as dat1
from partypaymentdetails
where sectionname='Owner' and partyname='celv'
order by sectionname, YEAR(date) asc , 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

Login to post response