• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1866
  • Last Modified:

SQL needed to find character length for each record of a field

Hi, I need to run a query that will tell the length of characters for each record; so:
fieldA = somedata
fieldB = somemoredata
Then the query would return:
fieldA = 8
fieldB = 12
Can anyone assist?
1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
select len(fieldA), len(fieldB) from yourtable
something like this...you'll need to do it for each field

select len(ltrim(rtrim(fieldname)))
from yourtablename
jimshockAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now