Solved

MID string

Posted on 2004-04-08
9
2,620 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 20 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 20 total points
ID: 10788395
Use substring(string,startofstring, len(String)-startofstring)
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

718 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