?
Solved

MID string

Posted on 2004-04-08
9
Medium Priority
?
2,621 Views
Last Modified: 2008-03-17
How do I do a Mid string function in SQl. I can do a Left(string, 4) and right function.....but how do I do the Mid??
0
Comment
Question by:AutomaticSlim
[X]
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
  • 5
  • 2
  • 2
9 Comments
 
LVL 27

Accepted Solution

by:
Dabas earned 80 total points
ID: 10788237
Hi AutomaticSlim:
Try SubString

SUBSTRING (T-SQL)
Returns part of a character, binary, text, or image expression. For more information about the valid Microsoft® SQL Server™ data types that can be used with this function, see Data Types.

Syntax
SUBSTRING(expression, start, length)

Arguments
expression
Is a character string, binary string, text, image, a column, or an expression that includes a column. Do not use expressions that include aggregate functions.
start
Is an integer that specifies where the substring begins.
length
Is an integer that specifies the length of the substring (the number of characters or bytes to return).

Dabas
0
 

Author Comment

by:AutomaticSlim
ID: 10788381
I know the Start of the string but the length depends, it could be 5,6,10 ...
and I want what ever it is after start...
0
 
LVL 10

Assisted Solution

by:Shailesh15
Shailesh15 earned 80 total points
ID: 10788395
Use substring(string,startofstring, len(String)-startofstring)
0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
LVL 27

Expert Comment

by:Dabas
ID: 10788396
AutomaticSlim:
SUBSTRING(expression, start, Len(Expression)-start)

Dabas
0
 
LVL 27

Expert Comment

by:Dabas
ID: 10788401
LOL. Got beat by seconds!
0
 
LVL 10

Expert Comment

by:Shailesh15
ID: 10788446
Don't worry.. he will split points!... :)
0
 
LVL 27

Expert Comment

by:Dabas
ID: 10788463
Shailesh15:
LOL. If we are lucky...
AutomaticSlim: You have questions open that are up to a year old!!!!!

Dabas
0
 

Author Comment

by:AutomaticSlim
ID: 10788574
Sorry guys...... I don't have the "split point" option since the number of points are too small.......


Dabas -

Which question are you refereing to that is almost a year old? I want to clean them up.....
0
 
LVL 27

Expert Comment

by:Dabas
ID: 10788646
6 open questions:
04/09/04 http://www.experts-exchange.com/Q_20948459.html "MID string"
03/10/04 http://www.experts-exchange.com/Q_20913102.html "Drop Down Menue bar Goes Under the Optio..."
02/26/04 http://www.experts-exchange.com/Q_20897925.html "SQL Server Remore Admin"
12/03/03 http://www.experts-exchange.com/Q_20814559.html "Query returns duplicates"
11/25/03 http://www.experts-exchange.com/Q_20807267.html ".aspx color coding in ASP.NET environmen..."
04/28/03 http://www.experts-exchange.com/Q_20598329.html "Having 2 Databases in Sync"
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

752 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