I have a concatonated field that holds 4 values.
SchoolID+StudentID+Grade+SchoolYear AS
I need to get extract out one value (grade). Originally I did this:
CAST(SUBSTRING(NewIdentity, 8,2)AS VARCHAR)
Worked ok until I realized that some of the studentids vary in length between 1 to 4.
So now I'm wondering can I get the data from the right? I know that the last 2 parts of this value will always use 7 character spaces.
Coming from the left there can be anywhere between 4-7 character spaces.
Make sense? Seems like it should be easy to do?
thanks,
j
SchoolID+StudentID+Grade+SchoolYear AS
I need to get extract out one value (grade). Originally I did this:
CAST(SUBSTRING(NewIdentity, 8,2)AS VARCHAR)
Worked ok until I realized that some of the studentids vary in length between 1 to 4.
So now I'm wondering can I get the data from the right? I know that the last 2 parts of this value will always use 7 character spaces.
Coming from the left there can be anywhere between 4-7 character spaces.
Make sense? Seems like it should be easy to do?
thanks,
j