devxlogo

Truncating the Last Five Characters in a Field

Truncating the Last Five Characters in a Field

Question:
How do I truncate the last five characters in a field? (The string length varies from row to row.)

Answer:
Try something along these lines:

select left(myfield, datalength(myfield)-5)

devx-admin

Share the Post: