Solved

How to convert this datetime Thu Sep 23 19:34:06 IST 2010 to mm/dd/yyyy format

Posted on 2012-03-23
4
779 Views
Last Modified: 2012-04-03
How to convert this datetime Thu Sep 23 19:34:06 IST 2010 to mm/dd/yyyy
0
Comment
Question by:Loganathan Natarajan
4 Comments
 
LVL 6

Accepted Solution

by:
wshark83 earned 167 total points
Comment Utility
here's a useful link which converts dates to various formats:

http://www.sqlusa.com/bestpractices/datetimeconversion/

basically you need to use the convert(datetime,<datefield>) functions
0
 
LVL 12

Assisted Solution

by:sachitjain
sachitjain earned 166 total points
Comment Utility
set @date = CONVERT(varchar(25), @dt, 101)

where @dt is your input datetime parameter i.e. Thu Sep 23 19:34:06 IST 2010
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 167 total points
Comment Utility
How to convert this datetime Thu Sep 23 19:34:06 IST 2010 to mm/dd/yyyy format
Assuming that value is not a datetime data type (otherwise the question would never have been posed) than I suspect you need something like this:
SELECT CONVERT(varchar(10), CAST(SUBSTRING(@YourDate, 5, 6) + ',' + RIGHT(@YourDate, 4) AS date), 101)
0
 
LVL 36

Author Closing Comment

by:Loganathan Natarajan
Comment Utility
thanks
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 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

16 Experts available now in Live!

Get 1:1 Help Now