Convert Date

Posted on 2011-09-08
Medium Priority
Last Modified: 2012-05-12

I am using the following query to grab a column in my db and convert the date.  I would like the full month to display if possible.  Currently, what I have is only displaying three characters in the month along with the day and year.  Any help would be appreciated

 SELECT CONVERT(VARCHAR(12), nextBillingDate_c, 107) AS [Month DD, YYYY]
  FROM members

Question by:nmarano
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 17

Accepted Solution

OriNetworks earned 2000 total points
ID: 36505053
SELECT DATENAME(MM, nextBillingDate_c) + ' ' + CAST(DAY(nextBillingDate_c) AS VARCHAR(2))+', ' +right(convert(varchar,nextBillingDate_c,101),4) AS [Month DD]
LVL 17

Expert Comment

ID: 36505093

select datename(MM,getdate()) +' ' + Convert(varchar,datepart(dd,getdate())) + ', ' + Convert(varchar,datepart(year,getdate()))

Author Closing Comment

ID: 36505101
Awesome!  Thank you very much!
LVL 17

Expert Comment

ID: 36505112
or to get it with the 2-digit day

SELECT datename(MM,getdate()) + ' ' + SUBSTRING(CONVERT(VARCHAR(8), GETDATE(), 3), 4, 2) +', ' + Convert(varchar,datepart(year,getdate()))

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

762 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