Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
Retrieve a substring
Retrieve a substring
Rate Topic
Display Mode
Topic Options
Author
Message
shohelr2003
shohelr2003
Posted Monday, March 04, 2013 3:16 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: 2 days ago @ 5:32 AM
Points: 124,
Visits: 324
Dear,
I want to find the time portion from the following string.
"Feb 18 2013 3:35PM"
please tell me the T-SQL to retrieve '3:35PM' as result
Thanks in advance
Post #1426154
Abu Dina
Abu Dina
Posted Monday, March 04, 2013 3:38 AM
SSC-Addicted
Group: General Forum Members
Last Login: Today @ 10:35 AM
Points: 492,
Visits: 2,148
select convert(varchar, cast('Feb 18 2013 3:35PM' as time), 100)
-----------------------------------
http://www.SQL4n00bs.com
Post #1426159
Pulivarthi Sasidhar
Pulivarthi Sasidhar
Posted Monday, March 04, 2013 4:15 AM
SSC Eights!
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 5:30 AM
Points: 870,
Visits: 522
SUBSTRING ( expression ,start , length )
SELECT SUBSTRING( 'Feb 18 2013 3:35PM', LEN('Feb 18 2013 3:35PM')-7, 6 )
Post #1426170
ChrisM@Work
ChrisM@Work
Posted Monday, March 04, 2013 5:13 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 9:27 AM
Points: 5,618,
Visits: 10,990
SELECT RIGHT('Feb 18 2013 3:35PM',7)
“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.”
- Gail Shaw
For fast, accurate and documented assistance in answering your questions, please read
this article
.
Understanding and using APPLY, (I)
and
(II)
Paul White
Hidden RBAR: Triangular Joins
/
The "Numbers" or "Tally" Table: What it is and how it replaces a loop
Jeff Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #1426189
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.