Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Transact sql month and year Jan-07 from datefield

Posted on 2007-08-10
2
Medium Priority
?
575 Views
Last Modified: 2012-08-14
HOw do I get datefield in transact sql to show me Jan-07,Feb-07?
I used month() and I get numbers

I use datepart(mm, Datefield) and get numbers.
0
Comment
Question by:MarcosInfo
2 Comments
 
LVL 15

Expert Comment

by:derekkromm
ID: 19672589
select convert(varchar, getdate(), 107)
0
 
LVL 15

Accepted Solution

by:
dbbishop earned 2000 total points
ID: 19672800
select convert(char(3), getdate(), 107) + '-' + convert(char(2), getdate(), 2)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question