Solved

query problem

Posted on 2002-04-02
4
127 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
Comment Utility
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
Comment Utility
? 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
Comment Utility
no codes
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
what codes?
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now