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 danielledunham on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using LIKE in a query

Status
Not open for further replies.

enak

Programmer
Joined
Jul 2, 2002
Messages
412
Location
US
I am now an Access programmer but I have a client that has asked me to update some Access queries. I have been able to do everything that they asked except one thing. The database was not designed very. I need to get data from one table based on the results from another query. I need to retrieve a name from a table. The name is stored in another table but not if the same format so I need to use LIKE. Here is how I am using it:

(select lkupInHouseCounsel.Address1 from lkupInHouseName where lkupInHouseCounsel.CounselName Like (' (select amocoatty from tblcaseinfo where tblcaseinfo.caseid = [qryBilling_GetSplitsByEntity_ALL_1].[CaseID]) AS AmocoAtty ') *')

I don't know how to do this. Can anyone help?

TIA
enak
 
Im not expert on this at all, but i think you need to put in a wildcard somewhere. Wildcards in SQL are '%' (percentage).
example:

SELECT * from Names WHERE Surname LIKE 'jo%';

This will give you all the posts where the surname is starting with JO (eg. Johnson).


Good luck
-Claulle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top