Possible to count characters in a field

G

Guest

I wonder if it is possible to create a query that returns only those rows in
a table where the number of characters is => 250 in the LastName field. If
so, can I have the code?

Thank youl
 
J

Jeff Boyce

Len([YourFieldName])=>250

This goes in the Selection Criterion "cell" under the [YourFieldName] field.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

UHHmmm Jeff, shouldn't that be

Create a calculated field in the query and then input the criteria

Field: HowLong: Len([YourTable].[YourField])
Criteria: > 249

Or am I misinterpreting something here.


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Jeff Boyce said:
Len([YourFieldName])=>250

This goes in the Selection Criterion "cell" under the [YourFieldName]
field.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Billy B said:
I wonder if it is possible to create a query that returns only those rows
in
a table where the number of characters is => 250 in the LastName field.
If
so, can I have the code?

Thank youl
 
J

Jeff Boyce

Thanks, John.

I bet you're right! The Len(...) expression I offered would evaluate to
True or False, and Access would try to find a value of True (or False) in
the field!

Good catch!

Regards

Jeff Boyce
Microsoft Office/Access MVP

John Spencer said:
UHHmmm Jeff, shouldn't that be

Create a calculated field in the query and then input the criteria

Field: HowLong: Len([YourTable].[YourField])
Criteria: > 249

Or am I misinterpreting something here.


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

Jeff Boyce said:
Len([YourFieldName])=>250

This goes in the Selection Criterion "cell" under the [YourFieldName]
field.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Billy B said:
I wonder if it is possible to create a query that returns only those rows
in
a table where the number of characters is => 250 in the LastName field.
If
so, can I have the code?

Thank youl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top