Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 548
  • Last Modified:

MSSQL 2008: Get month (Jan,Feb..) from datetime

HI!

How do I format/convert the datetime  to only return a string with  the month? Jan,Feb, ...
0
ulf-jzl
Asked:
ulf-jzl
3 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
datename(month, yourdatefield)
0
 
EyalCommented:
SELECT left(cast( getdate() as nvarchar),3)
0
 
pritamduttCommented:
Checkout : select DATENAME(m,GETDATE())
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
ulf-jzlAuthor Commented:
so to get the 3 char?

CONVERT(Varchar(3), datename(month, month(getdate())))
0
 
pritamduttCommented:
or select Left(DATENAME(m,GETDATE()),3) to get first three char
0
 
ulf-jzlAuthor Commented:
ops..
select CONVERT(Varchar(3), datename(month, getdate()))
0
 
pritamduttCommented:
You already have the answer from Eval and Me for your last question...

Please take a look
0
 
ulf-jzlAuthor Commented:
Thx guys!! :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now