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!

Wild cards in fields

Status
Not open for further replies.

fmaca

Technical User
Apr 24, 2002
16
CA
Good morning all.

I have a query that is doing a comparison between two tables.

One column has data like 37820-P06-C52. There are literally thousands of possibilites because everything other than the 37820 varies. Not all variations are in the table though, only a few hundred at a time.

The second table has 37820-p* or some sort of wild card.

I can't get the query to recognize the wild card.

Both columns are text because most of the data is alpha-numeric.

Is there anything I can do?

Thanks

Ethan
 
Ethan:

Access hates specialized characters!
Why do you have a table with the number and a wildcard character? Why not just set the criteria of the query to be
Like "37820-p*" or if you want to prompt for the value set it to: "37820-" & Like "*[Enter some charaters]*"


"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
You will have to either redefine a new field in both tables or create two queries with a new column identified with just the first 7 characters. Then create a LEFT JOIN between the two tables/queries on these two fields/columns.

Query1:
Select A.*, Left$(A.IDField,7) as StrID7
FROM tblYourTableName1 as A;
Query2:
Select B.*, Left(B.IDField,7) as StrID7
FROM tblYourTableName2 as B;

Final Query:
Select A.*, B.*
FROM Query1 as A LEFT JOIN Query2 as B on A.StrID7 = B.StrID7;



Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top