Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MID string

Posted on 2004-04-08
9
Medium Priority
?
2,625 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

610 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