Need to get month and year from date [Resolved]

Posted by Sriharim under Sql Server on 5/6/2015 | Points: 10 | Views : 356 | Status : [Member] | Replies : 3
Need to get month and year from Date column


select convert(varchar(10),convert(varchar(20),convert(varchar(4),datename(month, HireDate))+' ' +convert(varchar(4),
year(HireDate)),103))
from employee


in below format (month/year)
09/2015

---
Srihari



Responses

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

Up
0
Down

Resolved
select RIGHT(CONVERT(VARCHAR(10), HireDate, 103), 7)  AS [MM/YYYY]
from employee


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

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

Posted by: Sriharim on: 5/6/2015 [Member] Starter | Points: 25

Up
0
Down
Also, please help me to resolve
http://www.dotnetfunda.com/forums/show/19671/csharp-script-in-ssis-script-component-to-insert-data

---
Srihari

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

Posted by: Amatya on: 5/9/2015 [Member] Bronze | Points: 25

Up
0
Down
select RIGHT(CONVERT(VARCHAR(10), HireDate, 103), 7) AS [MM/YYYY]
from employee

Feel free to share informations 9731764134
Thanks

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

Login to post response