Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple filter question?

Status
Not open for further replies.

bbuk

Technical User
Apr 27, 2002
44
GB
Hi

I've been trying to filter an ADO recordset (rsType) to distinguish between a list containing data like:

2 Axle Class V

and

2 Axle Class VII

etc.

with

rsType.Filter = "field2 Like '*CLASS V*'"

it returns both Class V and Class VII. Is there a way that I am missing?

TIA

Andy
 
Hey Andy you are using a wildcard operator afterwards... It also depends on which RDBM you are using.

[SQL Server]
rsType.Filter = "field2 Like '%CLASS V'"

[MS Access]
rsType.Filter = "field2 Like '*CLASS V'"



Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Thanks Casper

I'm using MS Access, and it dosn't allow a wildcard * only at the start of the string -

rsType.Filter = "field2 Like '*CLASS V'"

causes error

"3001 - Arguments are of wrong type, out of acceptable range or in conflict with one another"
:(

Any other ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top