use SQL to find data with a fixed data length within column

column( A) in a database of datatype nchar with a data length of 32 i.e. nchar(32)

can some suggest suggest SQL to find rows with data length of fixed 30 characters in this column A?

Cheers
GMac
gerrymac1943Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jerry MillerConnect With a Mentor Commented:
This should work:

SELECT * FROM table_name WHERE LEN(columnA) = 30
0
 
jonnidipCommented:
Maybe you will need to add ltrim and rtrim to your column;
select * from table where len(ltrim(rtrim(columnA))) = 30
0
 
gerrymac1943Author Commented:
genius
0
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.

All Courses

From novice to tech pro — start learning today.