Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Filter

Posted on 1997-11-17
2
Medium Priority
?
214 Views
Last Modified: 2010-04-04
Can't I use the 'IN' or 'LIKE' statement in a filter? If not I guess I have to make an SQL Query? If I can,what's the syntax? Delphi is very persistent in telling me I'm trying to do something stupid....
0
Comment
Question by:lizzzard
[X]
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
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 150 total points
ID: 1350760
Unfortunatley, there really ins't a equivelent function to LIKE or IN with filters, but you may be able to use the setRange function.  You can use the setRange to filter on words that say start with 'A' which would bring back Ann, Abe, etc.  The full syntax for SetRangeStart - SetRangeEnd and ApplyRange are in the Help manual, but I provided an example below.  If you have any questions, please add a comment.

with Table1 do
  begin
    SetRangeStart; { Set the beginning key }
    FieldByName('City').AsString := 'Ben Lomond';
    SetRangeEnd; { Set the ending key }
    FieldByName('City').AsString := 'Scotts Valley';
    ApplyRange; { Tell the dataset to establish the range }
  end;

For more specific filter, you will have to use a Query.

Good Luck!

Jay
0
 
LVL 3

Expert Comment

by:d4jaj1
ID: 1350761
On more thing, I left out the syntax to find all the 'A's I mentioned before.  It is,

With Table1 do begin
 IndexName := 'secind';
 SetRangeStart; //Starts setting the starting values
 FieldByName('FirstName').asstring := 'A';
 SetRangeEnd; //Starts setting the ending values
 FieldByName('FirstName').asstring := 'A' + #255; // All A's
 ApplyRange;
end;

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

705 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