Solved

Convert Date

Posted on 2011-09-08
4
230 Views
Last Modified: 2012-05-12
Experts-

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

Thanks
0
Comment
Question by:nmarano
  • 3
4 Comments
 
LVL 17

Accepted Solution

by:
OriNetworks earned 500 total points
Comment Utility
SELECT DATENAME(MM, nextBillingDate_c) + ' ' + CAST(DAY(nextBillingDate_c) AS VARCHAR(2))+', ' +right(convert(varchar,nextBillingDate_c,101),4) AS [Month DD]
0
 
LVL 17

Expert Comment

by:OriNetworks
Comment Utility
OR

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

Author Closing Comment

by:nmarano
Comment Utility
Awesome!  Thank you very much!
0
 
LVL 17

Expert Comment

by:OriNetworks
Comment Utility
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()))
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
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 …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now