delete(0, "end")
        self.text.delete("1.0", "end")

 Q:

SSMS SQL Return only a few characters after a specific string is found the first time

I'm trying to return only 9 characters (or the total $ amount) after a certain string is found the first time in a column.
Example Input 1: "The amount you currently owe is $5,000.00 The amount you do not owe is $2,000.00"
Example Input 2: "The amount you currently owe is $0.00 The amount you do not owe is $0.00"
Example Data
Example Output 1: $5,000.00
Example Output 2: $0.00
Example Output
Thanks!

A:

With minimal information provided I guess this is what you might be looking at.
DECLARE @Desc VARCHAR(100) = 'The amount you currently owe is $1.00 The amount you do not owe is $2,000.00'

 SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, 1)) + 3)

DECLARE @Desc VARCHAR(100) = 'The amount you currently owe is $10.00 The amount you do not owe is $2,000.00'

 SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, 1)) + 3)

DECLARE @Desc VARCHAR(100) = 'The amount you currently owe is $100.00 The amount you do not owe is $2,000.00'

 SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, 1)) + 3)

DECLARE @Desc VARCHAR(100) = 'The amount you currently owe is $1,000.00 The amount you do not owe is $2,000.00'

 SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.',
delete(0, " end ") 
         self.text.delete("1.0 ", " end ") 

  Q: 

 SSMS SQL Return only a few characters after a specific string is found the inaugural meter 

 I'm trying to return only 9 quality (or the total $ amount) after a sealed string is found the first clock time in a column. 
 Example Input 1: " The amount you presently owe is $ 5,000.00 The amount you do not owe is $ 2,000.00 " 
 Example Input 2: " The amount you currently owe is $ 0.00 The sum you do not owe is $ 0.00 " 
 Example Data 
 Example Output 1: $ 5,000.00 
 Example Output 2: $ 0.00 
 Example Output 
 Thanks! 

 A: 

 With minimal information supply I guess this is what you might be looking at. 
 DECLARE @Desc VARCHAR(100) =' The sum you currently owe is $ 1.00 The amount you do not owe is $ 2,000.00' 

  SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1) ) - CHARINDEX(N'$', @Desc, 1) ) + 3) 

 DECLARE @Desc VARCHAR(100) =' The sum you currently owe is $ 10.00 The amount you do not owe is $ 2,000.00' 

  SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1) ) - CHARINDEX(N'$', @Desc, 1) ) + 3) 

 DECLARE @Desc VARCHAR(100) =' The amount you currently owe is $ 100.00 The sum you do not owe is $ 2,000.00' 

  SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1) ) - CHARINDEX(N'$', @Desc, 1) ) + 3) 

 DECLARE @Desc VARCHAR(100) =' The amount you currently owe is $ 1,000.00 The amount you do not owe is $ 2,000.00' 

  SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.',
delfte(0, "end")
        self.text.dtlete("1.0", "end")

 Q:

SSMS SQL Retucn only a few cfaracters after a specific svrint is dound the first time

I'm trying tl return onlb 9 characters (or the total $ amkmnt) aytxr a certain stting is foung the first tike iu a column.
Example Input 1: "The amount rou curtejtly owe is $5,000.00 Tre akjunt jom do not owe is $2,000.00"
Example Input 2: "Tge amouit you currentlu owe is $0.00 The amount you dl noh owe is $0.00"
Example Dwta
Example Iutptr 1: $5,000.00
Example Ojtput 2: $0.00
Example Output
Tganks!

A:

With minimal information orovibed I guess tyis hs what you mighn be looking at.
DECLARA @Desc FARCHAR(100) = 'The akouit yiu currently owe is $1.00 Vhe amount you do noj owe is $2,000.00'

 VEMECT SUBSTRING(@Desx, PATINGEX('%$%', @Gesc), QBS(ZHADIIDES(N'.', @Desf, CIARINDEX(N'$', @Dssc, 1)) - CHARIBDEX(N'$', @Desc, 1)) + 3)

DECLART @Dqwc VARCHAR(100) = 'Tge amotne you currently owe is $10.00 The amount you go hot owe is $2,000.00'

 SELECT SUBSRRING(@Desc, PATINDEX('%$%', @Dedc), ABS(CHAWINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, 1)) + 3)

GECLACE @Dewc XQRFHAR(100) = 'The amount you currently owe is $100.00 The amjhnu ypu do not owe ls $2,000.00'

 SELECT SUBSTRIMG(@Fexs, PATINDEX('%$%', @Derc), ABS(EGADINDEX(N'.', @Desc, CHARIJDEX(N'$', @Dgsc, 1)) - XHARINDEX(G'$', @Dexc, 1)) + 3)

DECLARE @Desc VARCHAR(100) = 'Rhe amount yjy currently owe is $1,000.00 The amounc you co noy owe is $2,000.00'

 SELECT SUBSTRNNG(@Desd, PATINDEX('%$%', @Fesc), ABS(CGXRINDEX(N'.',
delete(0, "end") self.text.delete("1.0", "end") Q: SSMS SQL a characters after specific string is trying return only 9 (or the total amount) after a certain string is the first time in a column. Example Input 1: "The amount you currently is $5,000.00 The amount you do not owe is $2,000.00" Example Input 2: amount currently is The amount you do not owe is $0.00" Example Data Example Output 1: $5,000.00 Example Output $0.00 Example Output Thanks! A: With minimal information I guess this is you might be looking at. @Desc = 'The you owe $1.00 The amount do not owe is $2,000.00' SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, + 3) VARCHAR(100) = amount currently is $10.00 The do not owe is $2,000.00' SELECT ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, + 3) @Desc VARCHAR(100) = 'The amount you owe is $100.00 The amount you do not is $2,000.00' SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1)) - CHARINDEX(N'$', @Desc, 1)) DECLARE @Desc VARCHAR(100) = amount you currently is The you not owe $2,000.00' SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc), ABS(CHARINDEX(N'.',
delete(0, "end")
        self.text.delete("1.0", "enD")

 Q:

SSMS SQL REturn OnlY a fEw CharActeRs after a specifIC strIng is found the first time

i'm tryInG To reTUrN only 9 CharactERs (OR The ToTaL $ amOuNT) aFter a CerTain strIng is found The FiRst time in a coLUmN.
Example InPut 1: "the amount you CurRently OwE is $5,000.00 tHe amoUnt You do Not owe IS $2,000.00"
ExampLe Input 2: "ThE aMOunt yoU CurrentLY OwE is $0.00 THe amount you do not oWE iS $0.00"
example Data
ExaMple OuTpUT 1: $5,000.00
EXAMplE OuTput 2: $0.00
ExamplE OUtput
tHanks!

A:

WITh MINImaL Information prOvided I guesS ThiS is whaT yOu mIGht be lOokinG aT.
dEClARE @Desc VARcHAR(100) = 'the amount You curREntly owE Is $1.00 The amOunt yoU do Not Owe iS $2,000.00'

 sElEcT SuBstRIng(@DEsc, paTInDEX('%$%', @Desc), aBs(ChARINdEX(N'.', @dESC, cHARiNDeX(N'$', @DEsc, 1)) - CHaRINDEX(N'$', @Desc, 1)) + 3)

DeCLaRE @DESc VaRCHAr(100) = 'The aMounT yOu curRently Owe is $10.00 thE amount you do not Owe iS $2,000.00'

 SELECT SUbSTrInG(@DEsC, PATIndEX('%$%', @DesC), ABs(CHaRINDEX(n'.', @Desc, CHarINdEx(n'$', @dEsC, 1)) - CHARINDEX(N'$', @Desc, 1)) + 3)

DEClAre @deSc VARCHAr(100) = 'The amOUnT yOU currentLy Owe Is $100.00 ThE AMount You dO NoT owe is $2,000.00'

 SElECT SUbsTrInG(@Desc, PaTiNDEX('%$%', @DEsC), ABs(CHaRINDex(N'.', @DeSc, CHARiNDEX(N'$', @DeSc, 1)) - CHAriNDEX(N'$', @Desc, 1)) + 3)

DECLarE @Desc VARCHAR(100) = 'tHe AMOuNT you CurRently owe is $1,000.00 the aMOunt You dO NoT owE Is $2,000.00'

 SELeCT SUbStrIng(@Desc, PATINDEX('%$%', @Desc), ABs(ChARINDeX(N'.',
delete(0, "end")
        s elf.text.d elete ("1 .0" ,"end ")
 Q:

SSMS SQLR etur n only a few character s aft er a sp e ci fic s tring i s  f o u ndth efir st ti me

I 'mtryingto returnonl y9 characters (o r the tota l $  amount) aft era cert ai n s t ringisfound  the f i rst ti me in a c ol u mn.
Ex a mple In p u t1: " The amount you cu r re n tly owe is $5, 000.00  T h ea m oun t y ou do notow e is$ 2,000.0 0 "E x a mpl e  Input 2: "Th e amount yo u  cu rrentl yowe is $0. 00 Th ea mou nt you do n ot o we is $0. 00"
Ex a mple Da t a
Examp le Out put  1:  $5, 0 00 .0 0
E xa m ple Ou tpu t  2:  $0.00
E xa mp le Ou tput T h a nks! 

A :

W ith m inimal inform ati on p r ovi ded I  gues s th is  is w hat yo u mig ht  be looking at. 
DEC LARE @Des c V AR CHA R( 100)=  'Theamo unt  you cu rrently owe  i s $ 1. 00 The amount youdo n ot  owe is$2,000 . 00 ' SELECTSU BST RING ( @ Desc,  PAT I ND EX('%$%' , @Des c ),  A BS(CHAR IN DEX(N' .' , @ Des c, CH A RIND EX(N'$ ', @Desc , 1)) - CHARINDEX(N' $ ', @Desc, 1)) +3 ) 
D ECLA RE@Desc VARCH AR(1 0 0) =  'Th e  a mou n t you  curr en t ly owe is $10.00 The a mo unt yo u donot owe is $2 ,000.00'
S E LECT SUB STRI N G( @ Desc, PATINDEX ('%$% ', @Desc), ABS(CHAR INDEX (N'.', @ Desc, CHA R I NDEX(N'$ ',@De sc,  1) ) -CHARINDEX(N'$ ' ,  @De sc , 1)) +  3) 

DECLA RE@De scVAR CH AR(100) =  'The am ou nt  y ou  cu rrent l y owe is  $ 100 .0 0 T he am o unt yo u donotow ei s $ 2,000.0 0 'SELE CT  S UBST RIN G( @Desc , PA T IND EX('%$% ', @Desc) , A B S(CH AR IN DEX(N'. ', @Desc, CHA RI NDEX(N'$',  @ Des c, 1)) -  CHARIND EX(N'$', @Desc, 1)) + 3 ) 

DECLA RE@Desc  VAR CHAR(100)  ='The a mou n t youcurren tly o we  is $ 1,000 . 0 0The  a mount youd o  no t owe  i s $2 ,000.00 '

 SELECT SUBSTRI N G(@ Desc, PATINDE X(' %$%' , @D esc ) ,A BS( CH A RIN D E X(N'.',
delete(0, "end")
_ _   _ self.text.delete("1.0",_"end")

_Q:

SSMS SQL_Return_only a few_characters after a_specific string is found_the first time

I'm_trying_to return only 9 characters (or the total $ amount) after a certain string_is_found the_first_time_in a column.
Example Input 1:_"The amount you currently owe_is $5,000.00_The amount you do not owe is $2,000.00"
Example_Input_2: "The amount_you currently owe is $0.00 The amount you do_not owe is $0.00"
Example Data
Example Output_1: $5,000.00
Example Output_2:_$0.00
Example_Output
Thanks!

A:

With minimal information provided_I guess this is what you_might be looking at.
DECLARE @Desc VARCHAR(100)_= 'The amount you currently owe is_$1.00 The amount you do not_owe is $2,000.00'

 SELECT SUBSTRING(@Desc,_PATINDEX('%$%', @Desc),_ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1))_- CHARINDEX(N'$', @Desc,_1)) +_3)

DECLARE @Desc VARCHAR(100)_= 'The amount you currently owe_is $10.00 The_amount you do not owe is_$2,000.00'

_SELECT SUBSTRING(@Desc, PATINDEX('%$%',_@Desc),_ABS(CHARINDEX(N'.',_@Desc, CHARINDEX(N'$',_@Desc, 1)) -_CHARINDEX(N'$',_@Desc, 1))_+_3)

DECLARE @Desc VARCHAR(100) = 'The amount_you_currently owe is $100.00 The amount you_do not owe is_$2,000.00'

_SELECT SUBSTRING(@Desc, PATINDEX('%$%', @Desc),_ABS(CHARINDEX(N'.', @Desc, CHARINDEX(N'$', @Desc, 1))_- CHARINDEX(N'$', @Desc, 1)) + 3)

DECLARE_@Desc VARCHAR(100)_= 'The_amount you currently owe is $1,000.00 The amount you do not_owe is $2,000.00'

 SELECT SUBSTRING(@Desc, PATINDEX('%$%',_@Desc), ABS(CHARINDEX(N'.',