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

TAdoQuery . SQL ---- Truncate or Like?

Status
Not open for further replies.

PaidtheUmpire

Programmer
Jan 4, 2004
105
AU
i have a field made up of two parts...

An ID code (first 5 digits) and
An Location Code (next 7 characters).

Is there a way in Delphi 7's SQL to make a WHERE function which will let me get all values where the Location Code is the same? But the big thing is that I need to be able to place the 'ith' in the below statement through the code (as it will change each time)

ie.
SELECT *
FROM Clients
WHERE Name = %ith

DISPLAYS: Smith, Bith NOT Smithcus.
 
hi

Do you want this?

WHERE Name like '%ith%'

I'm not quite sure what you're asking with the LocationCode bit. Do you want to 'group by' location codes or a simple condition?

WHERE Name like '%ith%'
and LocationCode = 'something'

lou

 
Check out the FAQ area

Search capability in a Tquery using common vcl components
faq102-3597

for some ideas


Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top