Return only a portion of text

i have the following column which contains user names

GIDS/Martin
GIDS/Alex

I'd like to take out the GIDS/ portion of the text and only return the name 
at the end. Thanks for any help. 
0
Utf
8/23/2010 6:36:06 PM
sqlserver.programming 1873 articles. 0 followers. Follow

2 Replies
919 Views

Similar Articles

[PageSpeed] 15

On Mon, 23 Aug 2010 11:36:06 -0700, Qaspec
<Qaspec@discussions.microsoft.com> wrote:

>i have the following column which contains user names
>
>GIDS/Martin
>GIDS/Alex
>
>I'd like to take out the GIDS/ portion of the text and only return the name 
>at the end. Thanks for any help. 


As in:

DECLARE @str varchar(100)

SET @str = 'GIDS/Martin'

SELECT RIGHT(@str,LEN(@str)-CHARINDEX('/',@str))

John
0
John
8/23/2010 7:30:05 PM
On Mon, 23 Aug 2010 11:36:06 -0700, Qaspec
<Qaspec@discussions.microsoft.com> wrote:

>i have the following column which contains user names
>
>GIDS/Martin
>GIDS/Alex
>
>I'd like to take out the GIDS/ portion of the text and only return the name 
>at the end. Thanks for any help. 

     Look at substring().

Sincerely,

Gene Wirchenko
0
Gene
8/23/2010 7:30:20 PM
Reply:

Similar Artilces:

Customer Returns
I'd like to know if there someone has written a RMS report that shows the customer account number, customer's name (last, first), and other customer statistics that INCLUDE pieces purchased and pieces returned. Or, if someone with more knowledge of SQL would care to share their coding expertise to accomplish the same, it would be appreciated. ...

How do I wrap text in a text box around another text box
I'm creating a newsletter with columns. I have a horizontal text box with the article title. I want the vertical column at the same height as the top of the horizontal column. Right now the text in the vertical column is going through some of the horizontal box. I want it to wrap. I've tried to selecting "square" for each of the two boxes wrapping style. Nothing changes. How do I get the text to wrap around the horizontal text box? I'm using Publisher 2003 I found a way around this by copying another textbox from the template that was apprently already set ...

Return-Path: <> from Postmater
Hi, I got Exchange 2003 SP1 on Windows 2003 in Native Mode and when I receive bad mail the response is made from postmaster@mydomain.com but the return-path field is blank. With some anti-spam filter this Email is Junk. Return-Path: <> Anybody know how to specifeid a return-path to the NDR mail? _____________ Thank you Sebastien On Fri, 4 Nov 2005 12:48:04 -0800, "Sebas" <Sebas@discussions.microsoft.com> wrote: >Hi, > >I got Exchange 2003 SP1 on Windows 2003 in Native Mode and when I receive >bad mail the response is made from postmaster@mydomain.c...

Site for SOP Returns
Is it possible to have a different default Site ID for Returns than Standard Orders? Yes. You must make sure to change the site when performing a Return Transaction. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com "Everton Raymond" wrote: > Is it possible to have a different default Site ID for Returns than Standard > Orders? Sorry, I did not see the word "default" in your post until after I r...

Function In A Text Box
Hi, I am trying to put a concatenate function in a text box. The error message is as follows: The text you have entered is not a valid reference or defined name. I want to concatenate some text with a number from the cell, A2. Any ideas would greatly appreciated. Regards Tubbsy -- tubbsy ------------------------------------------------------------------------ tubbsy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24743 View this thread: http://www.excelforum.com/showthread.php?threadid=388332 Its not a perfect solution but you could perform the concat...

Merge/consolidate text cells based on unique keys ?
Hi all. I hope someone can help me out. I have an Excel worksheet with 2 columns: 'Client #' and 'Invoice #'. Every time the accounting dept. generates an invoice, a new row is added in this worksheet. Obviously this is chronological not per Client #. But for the sake of simplicity, let's assume the worksheet is already sorted by Client #, like so: A B Client # Invoice # 231 5929 231 4358 231 2185 231 6234 464 1166 464 1264 464 3432 464 1720 464 9747 791 1133 791 4930 791 5496 791 6291 989 8681 989 3023 989 7935 989 8809 989 8873 My goal is to achieve...

Query regarding A,B,C char. width values returned in 16-bit and 32-bit OS
I am trying to retrieve individual character widths of a string (from a TrueType font) and I tried using GetCharWidth (which weirdly works for TrueType fonts too tho' MSDN says otherwise) and/or GetCharABCWidths to retrieve the A,B and C spacings. Please note that I have selected the TrueType font (hFont) into the Device Context (hDC). I used GetCharABCWidths. Problem is this: GetCharABCWidths returns correct A,B and C widths in Win 98 and incorrect (much lesser A,B and C widths such that the characters OVERLAP) in other 32-bit OS (NT, XP). The effect is seen across all TrueType fonts, th...

Report for Returns
Anyone know a why to report on frequency of customer returns -- so we can see if any customers are making habit of this? Thanks and regards, Rich hitman, Try running a detailed sales report filtered to only negative sales displayed. Good luck, Matt "hitman" <hitman@discussions.microsoft.com> wrote in message news:0B3EE780-2655-45B4-B3C6-1F5D35FFA2A7@microsoft.com... > Anyone know a why to report on frequency of customer returns -- so we can > see > if any customers are making habit of this? > > Thanks and regards, > > Rich ...

Restrict memo field to size of text box
Hi, I have a form with a text box that gets data from a memo field in a table. As the user enters data in the text box I want the input to be restricted to the size of the text box. Right now as the user types, once the box is full the data scrolls up. Is there a way to make input stop once the box is full? Thanks in advance, Phil Without a fixed width font like Courier New, you really can't easily tell when the textbox is full. If you use a fixed font, you might try something like this (aircode): Private Sub txtMyMemo_Change() ' 150 or whatever the number of ch...

Returning the Beginning of the week
Returning the beginning of the week. e.g. if the date == 02/03/04 (Friday 2nd March 2004) the beginning week for that date == 01/03/04 (Thursday 1st March 2004) Hows does one go about achieving this? Regards -- Rizitsu ------------------------------------------------------------------------ Rizitsu's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=15840 View this thread: http://www.excelforum.com/showthread.php?threadid=314968 This formula will take a date in cell A1 and give the start of the wee in B1 * assumes that monday is the start of the week, so i...

return
Capability of the system to automatically change the status of the PO to change order, and add line items that have been returned. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.ms...

Return
When returning an item, can you return the item by selecting the matrix rather than the individual item and changing the quantity to -1? Hi KIm, Normally this won't work as it works in sale where for each matrix type you can put the qunatites. HOWEVER when you select the matrix item it bring the matrix window but allow only one item at a time to be returned and make the -1 qty automatically in return document type. It work but one by one. Regards Akber "Kim" wrote: > When returning an item, can you return the item by selecting the matrix > rather than the individua...

soap serialisation to text
I want to be able to serialise an object and then pass the serialisation text as a string to a Web service without serialising to a file first. I also want to be able to deserialise from the text without using a file. How can I do these? Brenton I think I have the answer provided for me in the response to an earlier query: "Sending seralized XML by TCP". "BrentonMCA" wrote: > I want to be able to serialise an object and then pass the serialisation text > as a string to a Web service without serialising to a file first. > > I also want to be able to des...

Linking two text boxes
I have a text box on page one of a document and I have another text box on page two of the same document. I want both boxes to contain the same text - although formatted differently. How can I type it once and have it automatically change in the second text box? Best way is to copy/paste the text and re-format. There really isn't any easy way to synchronize objects. JoAnn Paules had a way to use a text box from a newsletter template. Look for a post dated May 6, 4:20 PM by Jim. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com ...

Returning Multiple Values in a Single Cell
Hello, I posted this same question a couple of weeks ago but forgot to mention a key point. My question was as follows: I have read a few posts regarding this subject but am still somewhat lost. I have a two sheet workbook (Excel 2000). On the first sheet is a list of projects that my department will complete during the year. A description of each project is given, a start date, an end date, as well as which crew will be completing the work (Crew 1 or Crew 2). What I am trying to do on the second sheet is to be able to type in any date, and have the description of the project on that da...

Returns immediate function
Hi all, I know that the function CeRapiInitEx returns immediately. No wait for processing. I want to implement such a function. Returns immediate. no wait. How do I implement such a function? Thanks Ko You might create a UI thread that do the work, launch it in the "non-wait" function and return immediatly to the caller. When the thread done it's works, you can post an application message to return the results.... Greetings, Gaetano Sferra "PPC DEV" <ppc_dev@yahoo.com> ha scritto nel messaggio news:033101c3b388$a7098910$a301280a@phx.gbl... > Hi all...

Lookup Values, return multiple.
I need help please. The formula I require has to in Worksheet A :- [B1] lookup DATA in Worksheet A [A1] SP001 in worksheet B [A] [B] [C] SP001 PL001 16 SP001 PL002 5 SP001 DR001 10 CR001 PL001 2 Search for all Text String starting with "PL" in Worksheet B [B] only for SP001 in [A] and return with values from Worksheet B [C] 16 and 5 I need the values to be seperated and not summed. Tx. Appreciate assistance. Try this... In the formulas: Rng1 refers to worksheet B $A$2:$A$5 Rng2 refers ...

Text Stops Wrapping
I have entered approximately 2000 characters of text in a cell. I have formatted the cell alignment right, top, wrap text and resize the cell to show the text. However, around the 1000 to 1200 character range, the text stops wrapping. Has anyone experienced this and discovered a workaround. Thanks. Excel can only handle about 1024 characters in a cell. Try using a textbox -- if you clear the borders & change row heights, it'll look just like a cell. "Daniel" <daniel.brady@warren.af.mil> wrote in message news:031201c3723d$8d1ac820$a101280a@phx.gbl... > I have e...

Setting text of the statusbar of MainFrm.cpp, from View class
Hi, I have a MFC project that has a statusbar. The statusbar is initialized in MainFrm.cpp as follows: [code] int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) .... if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } [/code] It is not assigned to an identifier nor it is referenced in a header. How can I display text on it from my View class? Thanks! AfxGetMainWnd, downcast the pointer and refer the statusbar variable ..... Or .....

Pound (#) signs instead of text
I entered text in a cell that is formatted for text and wrap. When I hit enter it shows as pound signs. I've tried making the cell wider and taller but that didn't help. I used the format brush to copy the format down from the cell above...still doesn't work. If you select the cell, does the text show up in the formula bar? -- Gary''s Student "mommyo" wrote: > I entered text in a cell that is formatted for text and wrap. When I hit > enter it shows as pound signs. I've tried making the cell wider and taller > but that didn't help. ...

% Return Line graph?
Hi- Can someone show me how to customize a graph in Money 2005 to show my stock portfolio's % change over time? I just want a simple line chart showing my percentage change since the beginning - as a way to just figure out relative performance but I can't seem to find the right graph to customize. I can't just chart the value of the portfolio as I have been adding money to it over time which has drastically changed the % returns. I am not sure if what I want is possible or if this is clear but I also have the plugin for MS Excel that I can import money data so if there is...

kit item return
There should be an option in the Store Op Manager --> Configuration --> Option Tab to allow the ability when returning a Kit Item to either return the quantity back to the Kit Items Inventory or to the Kit Item COMPONENTS Inventory. Effectively breaking out the Kit Item automatically when the item is returned to inventory. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to op...

Add alternative text to a graphic (alt text) in Cell
I can do a Alt text in a regular pic but when the pic is thebackground in a cell the form to enter text is greyed out. Is there way around this? "Ray" <Ray@discussions.microsoft.com> wrote in message news:17503F28-FA14-4732-8D18-030334459451@microsoft.com... >I can do a Alt text in a regular pic but when the pic is thebackground in a > cell the form to enter text is greyed out. Is there way around this? If it is a cell in a table, you can add a title attribute I would use the code view to do this, e.g. just type it in as <td title='My title'&...

Text Alignment in Calendar Cells
Hello, Publisher 2003 - I need to right align the calendar dates to the right but have all remaining content left align in the table cells. I created a style that would do this but it involves inserting simple line breaks as opposed to paragraph breaks in the cells. Is there a better solution out there? Chris ...

Top alignment with vertical text?
I want to align text to the top of the cell using vertical text, but cannot find any permutation of alignment options to do this. (The last letter of every cell will all be on same vertical level, the start of every text string will all be on different levels!) Any ideas, please? Hi Al, Setting Vertical alignment to Top and Orientation degrees to 90 worked for me. --- Regards, Norman "Al" <Al@discussions.microsoft.com> wrote in message news:98E501CF-0438-4A6B-ADEB-FA1A0F74FFAD@microsoft.com... >I want to align text to the top of the cell using vertical text, but...