Hi, using both SQL Srvr 2K DBs & OS and SQL 2005 DBs/OS.
Using t-sql, I need to extract the end of a string where the part I need is of a variable length: I cannot obviously use RIGHT(<string>,<int>), as this needs to return a specific number of characters it's nae use. I've fallen off my board many times surfing for an answer!
Examples of the string would be: -
"He had 20 eggs and he fried 12"
"He had 200 eggs and he fried 120"
where there is always a space before the number I need to extract from the end: note that there is a number inside the string and I do not want to extract this, so the code I know of that can extract all numeric digits is also no use.
Any suggestions much appreciated.
T Reid
Using t-sql, I need to extract the end of a string where the part I need is of a variable length: I cannot obviously use RIGHT(<string>,<int>), as this needs to return a specific number of characters it's nae use. I've fallen off my board many times surfing for an answer!
Examples of the string would be: -
"He had 20 eggs and he fried 12"
"He had 200 eggs and he fried 120"
where there is always a space before the number I need to extract from the end: note that there is a number inside the string and I do not want to extract this, so the code I know of that can extract all numeric digits is also no use.
Any suggestions much appreciated.
T Reid