Straight forward question 🙂
I have a column that is stored as such in SQL Server:
FileName Attachments_21046_123400100473.pdf
I need to grab the last segment before the file extension, in this case, it would be the 123400100473.
The last segment may vary in size of characters, so here it is 12 characters but sometimes it may be 15.
What would be the best way to go about this?
I’m not sure how many underscores come before the last segment, so I reverse the string and find the first underscore…