Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

query problem

Posted on 2002-04-02
4
130 Views
Last Modified: 2010-04-04
Using Query in Ttable
how can i get ALL records having:

*Partial Match at the beginning
*Exact Match
*Partial Match anywhere

and

*case sensitive or not case sensitive.

Example.
how can i get all records with using

(thefield >= 'Ant%') and (thefield <= 'Cat%')

when should i use "Like" and the logical operators like
"=",">=","<>"....?
0
Comment
Question by:girlswants_me
  • 2
4 Comments
 

Expert Comment

by:FTL001
ID: 6915200
use the % delimiter.  Example select * from users where lastname like '%mit%' would return smith,mithos,smithers.  Remove either the first or trailing % sign to eliminate partial matches in front of or behind.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6915258
? is this the answer

to girlswants me

like use with a single compare like
afield like 'abc%'

instead of >=,<= for a range use
afield between 'a%' and 'b%'

for caseinsensitive use
upper(afield) like upper('abc%')

upper (or similar function)
must be supported by your database

meikl ;-)
0
 

Author Comment

by:girlswants_me
ID: 6916774
no codes
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6925028
what codes?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question