Im doing a school project and i need to transform a column that contains both hh:mm:ss and h:mm:ss into only hh:mm:ss. I have tried string manipulation, string to date time but nothing changes. I would apreciate if anywone could share a way to detect if a record only had 7 digits and add a 0 to the start. While i could do it in the file itself that wouldn’t add any value to my project.
what you are looking for is called “padding”. it can be used to add the needed amount of characters either at the beginning or end of a text string, to make them all at least n places long.
in this case, you could just padleft(column, 8, “0”)