Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT based on field string length 1

Status
Not open for further replies.

jimoblak

Instructor
Oct 23, 2001
3,620
US
Is it possible to make a selection based on the length of the string in a field?

I have a text field that is supposed to be 4 characters long. Some fields incorrectly imported with 3 characters. I need to locate these shorter strings to place/pad a 0 at the start of the string.

Example data:
312
311
1211
S210

should be:
0312
0311
1211
S210

Is there some magical SQL to locate these 3-character strings and/or add the leading zero?

- - picklefish - -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top