A couple of more ways...
SELECT LEFT([Journal Name],LEN([Journal
Name])-CHARINDEX(':',REVERSE([Journal Name])))
SELECT SUBSTRING([Journal Name],1,LEN([Journal
Name])-CHARINDEX(':',REVERSE([Journal Name])))
--
Darren Brinksneader MCDBA, MCSE+I, CNE, CCA, MCT, CTT
> Not exactly, but REVERSE() and CHARINDEX() together work:
> If [Journal Name] is, say, varchar(80),
> REVERSE(
> SUBSTRING(
> REVERSE([Journal Name]),
> 1+CHARINDEX(':', REVERSE([Journal Name])),
> 80)
> )
> is [Journal Name] with everything after the last colon deleted.
> Steve
> > I have a table with one column called [Journal Name] which has a couple
of
> > colons ":" in the field. I'd like to delete all data after the last
colon.
> > Is there a function to find the last position of a character?
> > thanks
> > Daniel Bogesdorfer
> > Senior Programmer / Analyst
> > University Of Pittsburgh