Cheers for the solution DickieBird,
I've actually found another way to do it.
Changing
Reverse(Left(LTrim(reverse(sName)), (PATINDEX('% %', LTrim(reverse(sName))) - 1)))
To
LTrim(Reverse(Left(LTrim(reverse(sName)), PATINDEX('% %', LTrim(reverse(sName))))))
Has the desired effect.
Thanks...
I have a database (which I can't alter!) where people's first and last names are stored in a single column. I've written an ordey by statement (MSSQL 7) to order my output by the last name as below:
SELECT sName
FROM tblUsers
ORDER BY
Reverse(Left(LTrim(reverse(sName)), (PATINDEX('% %'...
Hello All,
I'm having problems with the output of queries that return the values from a decimal column in one of my tables. The values return as desired unless they are between 1 and 0. In this case the zero is truncated from before the decimal point. E.g
Value Returned as
1.56 1.56
7...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.