Data length

  • Thread starter Thread starter Nick Read
  • Start date Start date
N

Nick Read

Hello All

I trying to create a query in Access that will only select
data from a table when it exceeds a certain length i.e.

Col A | Col B

Row 1 A ABCDEFGHIJ

Row 2 C D

In the example above the query would only select the data
from row 1 of column B because the data in that cell is
greater than 10 characters long.

Thanks
 
Try something like

SELECT Table2.FieldA, Len([FieldB]) AS lengthF
FROM Table2
WHERE Len([FieldB])>10

HTH
 
Hi Nick,

If you are using the query builder, just enter len
([FieldAName]) as the field value in a blank column.
Then, enter >10 as the criteria (or whatever criteria you
want related to the length. If you want to specify a
name for the length column, just add the name followed by
a colon prior to the expression, such as

Column A Length: len([FieldAName])

Make sure to substitute your actual field name for
[FieldAName]. Also, the square brackets are only
required if your field name has a space.

HTH, Ted Allen
 
Back
Top