Text field database query problem

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Im doing a query with multiple criteria on a database that has similar
text items in one column. eg FM, FM3, FMO, or FMC6. If I query for
FMC6 I obtain the expected number of records but if I use just FM in
the query criteria I pull in all the additional FMxxx records. How do
I go about limiting the records pulled in by the query. Ive tried using
"FM" or 'FM' in the query but to no avail.

Thanks
 
Im doing a query with multiple criteria on a database that has similar
text items in one column. eg FM, FM3, FMO, or FMC6. If I query for
FMC6 I obtain the expected number of records but if I use just FM in
the query criteria I pull in all the additional FMxxx records. How do
I go about limiting the records pulled in by the query. Ive tried using
"FM" or 'FM' in the query but to no avail.

Thanks
Mike

I can't do it either but you might like to try Data, AutoFilter. This will
hide anything not FM.

Regards
Peter
 
Im doing a query with multiple criteria on a database that has similar
text items in one column. eg FM, FM3, FMO, or FMC6. If I query for
FMC6 I obtain the expected number of records but if I use just FM in
the query criteria I pull in all the additional FMxxx records. How do
I go about limiting the records pulled in by the query. Ive tried using
"FM" or 'FM' in the query but to no avail.

Sounds like your query is using LIKE('FM%') rather than = 'FM'. What are you
using for a data source?
 
MyndPhlyp said:
Sounds like your query is using LIKE('FM%') rather than = 'FM'. What are you
using for a data source?

A simple example will explain my problem.

Lets say I have a single column of data A1:A7 filled with text for my
database with header.
Class
FM
FM3
FM3
FMO
FM3
FMC6

C1:C2 is the query Class:FM
When I query the database with DCOUNT(A1:A7,1,C1:C2) the count returned
is 6 rather than the expected '1'. Only when I query for FMC6,FM3 OR
FMO are the correct counts returned.
 
How What
are you

A simple example will explain my problem.

Lets say I have a single column of data A1:A7 filled with text for my
database with header.
Class
FM
FM3
FM3
FMO
FM3
FMC6

C1:C2 is the query Class:FM
When I query the database with DCOUNT(A1:A7,1,C1:C2) the count returned
is 6 rather than the expected '1'. Only when I query for FMC6,FM3 OR
FMO are the correct counts returned.

Oops.. that should be DCOUNTA(A1:A7,1,C1:C2)
 
Back
Top