Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using property filter with table component

Posted on 2002-03-23
2
Medium Priority
?
163 Views
Last Modified: 2010-04-05
I want to filter a database with a date (filter is the only way with the tablecomponent I have to use (btrieve database).  Query is not possible.  The only fields I can use for this are three stringfields.  The day (string of 2: ex. '08'), month (string of 2: ex. '04') and year (string of 2: ex. '99').  There are always 2 characters.  The formule I hope to use is '<=20010901' where the first four characters are the year, the next two the month and the last two the day of the month.  
How can I do this.  I hope someone can help me.  The examples above should have to give as result:
'19990408<=20010901' so this record should be axcepted.  I can't configure this out.  Does anyone knows which formule I have to use to get this working.  I want to use in my code: table1.filter:='????'+'<=20010901';

Please help.

Dirk.

PS sorry for my poor English.
0
Comment
Question by:ka1a
[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 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 400 total points
ID: 6896319
You can use the OnFilter event of the table component, I think. Here's some text from the helpfiles:

The OnFilter event occurs each time a different record in the dataset becomes the active record and filtering is enabled.

type TFilterRecordEvent = procedure(DataSet: TDataSet; var Accept: Boolean) of object;
property OnFilterRecord: TFilterRecordEvent;

Description:
Write an OnFilterRecord event handler to specify for each record in a dataset whether it should be visible to the application. To indicate that a record passes the filter condition, an OnFilterRecord event handler must set the Accept parameter to True. To exclude a record, set the Accept parameter to False.
Filtering is enabled if the Filtered property is True. When an application is processing a filter, the State property for the dataset is dsFilter.
Use an OnFilterRecord event handler to filter records using a criterion that can’t be implemented using the Filter property.  For example, using the Filter property, field comparisons are not supported against local tables (Paradox, dBASE, Access, FoxPro), but an OnFilterRecord event handler can implement any criterion at all.
Note:     Be sure that the interactions between the Filter property and the OnFilterRecord event handler do not result in an empty filter set when they are used simultaneously in an application.
0
 

Author Comment

by:ka1a
ID: 6905257
Thanks Alex.  That does the job.

Thanks again.

Dirk.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

604 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