If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Need Mid Function
I have a ClientSampID that looks like this: T2/LA-10-(0-6)
I am looking for a statement that will pull the text after the "/" and before the first "-". Example: LA There may be more than 2 characters after the "/" and before the first "-". Example: T2/LAA-10-(0-6) This statemant works if there are only 2 characters but fails if tthere are mo Left(Trim(Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1,InStr(InStr(1,[ClientSampID],'-')+1,[ClientSampID],'-')-InStr(1,[ClientSampID],'-'))),InStr(1,Trim(Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1,InStr(InStr(1,[ClientSampID],'-')+1,[ClientSampID],'-')-InStr(1,[ClientSampID],'-'))),'-')-1)Help would be appreciated.Thanks in advanceDC |
#2
|
|||
|
|||
Need Mid Function
Try this --
Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1, InStr([ClientSampID],'-')-InStr(1,[ClientSampID],'/')-1) -- KARL DEWEY Build a little - Test a little "Dataman" wrote: I have a ClientSampID that looks like this: T2/LA-10-(0-6) I am looking for a statement that will pull the text after the "/" and before the first "-". Example: LA There may be more than 2 characters after the "/" and before the first "-". Example: T2/LAA-10-(0-6) This statemant works if there are only 2 characters but fails if tthere are mo Left(Trim(Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1,InStr(InStr(1,[ClientSampID],'-')+1,[ClientSampID],'-')-InStr(1,[ClientSampID],'-'))),InStr(1,Trim(Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1,InStr(InStr(1,[ClientSampID],'-')+1,[ClientSampID],'-')-InStr(1,[ClientSampID],'-'))),'-')-1)Help would be appreciated.Thanks in advanceDC |
#3
|
|||
|
|||
Need Mid Function
On Tue, 13 May 2008 15:53:36 -0600, Dataman wrote:
I have a ClientSampID that looks like this: T2/LA-10-(0-6) I am looking for a statement that will pull the text after the "/" and before the first "-". Example: LA There may be more than 2 characters after the "/" and before the first "-". Example: T2/LAA-10-(0-6) This statemant works if there are only 2 characters but fails if tthere are mo Left(Trim(Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1,InStr(InStr(1,[ClientSampID],'-')+1,[ClientSampID],'-')-InStr(1,[ClientSampID],'-'))),InStr(1,Trim(Mid([ClientSampID],InStr(1,[ClientSampID],'/')+1,InStr(InStr(1,[ClientSampID],'-')+1,[ClientSampID],'-')-InStr(1,[ClientSampID],'-'))),'-')-1)Help would be appreciated.Thanks in advanceDC So you wish to get LA or LAA from your examples? NewColumn:Mid([ClientSampID],InStr([ClientSampID],"/")+1,(InStr([ClientSampID],"-")-1)-InStr([ClientSampID],"/")) The above expression should be all on one line. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|