1) Below query return month name (from January to December) based on your record date.
select DATENAME(month,fieldname) from tablename
2) Below query is used to get only three charecter from the selected month
select Convert(varchar(3),DATENAME(month,empdate)) from empdt (or)
select Cast(DATENAME(month,empdate) as varchar(3)) from empdt
No comments:
Post a Comment