This may be a relatively simple question, but I've just spen the last few hours trying to implement different solutions to make it work, all with the same results.
I have a SQL table that contains the organization's computers. All of the PC names are identical in their format, and for that field there are a ton of records that have this as their data:
SITE - ROOM# - SERIAL# So, an actual PC name could be "SITE-123-123A".
I need to extract the room numbers only. The value between the two hyphens. I've got the code (in the code block below), that ~HALFWAY~ works, but can't seem to masage the rest of this.
VB is a much better way for me to do this, but I'm limited to forcing this into SQL. Any assistance you guys can provide would be greatly appreciated.
SELECT SUBSTRING(computer_name, CHARINDEX('-', computer_name) + 1, LEN(computer_name)) AS Test