Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
--- Preparing Test data
declare @Temp table (descr varchar(200))
insert into @Temp VALUES('2000 Ford Mustang')
insert into @Temp VALUES('1999 Harley Davidson SE1224')
insert into @Temp VALUES('2005 chevrolet cobalt')
insert into @Temp VALUES('2001 Mazda 6')
--- End
SELECT LEFT(descr,4) AS cYesr,
REVERSE(SUBSTRING(REVERSE(SUBSTRING(descr,5,8000)),CHARINDEX(' ',REVERSE(SUBSTRING(descr,5,8000))),8000)) AS Manufacturer,
REVERSE(LEFT(REVERSE(descr),CHARINDEX(' ',REVERSE(descr))-1)) AS Model
FROM @temp
create table blah2(col varchar(666))
insert blah2 values('2000 Ford Mustang')
insert blah2 values('1999 Harley Davidson SE1224')
insert blah2 values('2005 chevrolet cobalt')
insert blah2 values('2001 Mazda 6')
select LEFT(col,CHARINDEX(' ',col)-1)AS year,
SUBSTRING(col,
LEN(LEFT(col,CHARINDEX(' ',col)+1)),
len(col) -((len(RIGHT(RTRIM(col),CHARINDEX(' ',REVERSE(RTRIM(col)))-1))) +len(LEFT(col,CHARINDEX(' ',col)-1)))-1) AS Manufacturer,
RIGHT(RTRIM(col),CHARINDEX(' ',REVERSE(RTRIM(col)))-1) AS Make
from blah2
Declare @Temp Table(Data VarChar(100))
Insert Into @Temp Values('2000 Ford Mustang')
Insert Into @Temp Values('1999 Harley Davidson SE1224')
Insert Into @Temp Values('2005 chevrolet cobalt')
Insert Into @Temp Values('2001 Mazda 6')
Insert Into @Temp Values('2001 MyCar')
Insert Into @Temp Values('2001')
Select Left(Data, CharIndex(' ', Data)),
Replace(Replace(Data, Left(Data, CharIndex(' ', Data)), ''), LTrim(Reverse(Left(Reverse(Data), CharIndex(' ', Reverse(Data))))), ''),
LTrim(Reverse(Left(Reverse(Data), CharIndex(' ', Reverse(Data)))))
From @Temp
select f.matteridstring,
f.custom1,
Substring(l.itemtext, 12, 2) As itemtext
from contacts c,
parties p,
fileinfo f,
listbox l
where l.itemtext like 'Lemon Law%' and
c.contactid = p.contactid and
f.fileno = p.fileno and
f.filetype = l.id
select
f.matteridstring,f.custom1,
Substring(l.itemtext, 12, 2) As itemtext,
Left(f.custom1, CharIndex(' ', f.custom1)), Replace(Replace(f.custom1, Left(f.custom1, CharIndex(' ', f.custom1)), ''), LTrim(Reverse(Left(Reverse(f.custom1), CharIndex(' ', Reverse(f.custom1))))), ''),LTrim(Reverse(Left(Reverse(f.custom1), CharIndex(' ', Reverse(f.custom1)))))
from contacts c, parties p, fileinfo f, listbox l
where
l.itemtext like 'Lemon Law%' and
c.contactid = p.contactid and
f.fileno = p.fileno and
f.filetype = l.id
select f.matteridstring,
f.custom1,
Substring(Convert(varchar(500),l.itemtext), 12, 2) As "Year",
Left(Convert(varchar(500),f.custom1),
CharIndex(' ', f.custom1)),
Replace(Replace(Convert(varchar(500),f.custom1),
Left(Convert(varchar(500),f.custom1),
CharIndex(' ', Convert(varchar(500),f.custom1))), ''),
LTrim(Reverse(Left(Reverse(Convert(varchar(500),f.custom1)),
CharIndex(' ', Reverse(Convert(varchar(500),f.custom1)))))),
''),
LTrim(Reverse(Left(Reverse(Convert(varchar(500),f.custom1)), CharIndex(' ', Reverse(Convert(varchar(500),f.custom1))))))
from contacts c, parties p, fileinfo f, listbox l
where
l.itemtext like 'Lemon Law%' and
c.contactid = p.contactid and
f.fileno = p.fileno and
f.filetype = l.id