I have a unique column in a database called ID as varchar
This column contains data in such format as:
What I need to do is remove the first 3 characters ABC and then convert this to BIGINT data type.
I have managed to remove the first three characters using SUBSTRING
SELECT SUBSTRING(ID, 3, len(ID)) AS ID FROM table
However when trying to convert this as well to a BIGINT I am receiving a number of errors, this is what I have tried:
SELECT SUBSTRING(CAST(ID AS bigint),3,LEN(ID)) AS ID FROM table
Any help much appreciated.