RE: TZF -

[email protected]
Newsgroups gmane.comp.lang.delphi.topaz
Message-ID <[email protected]>
Jerry,

---------------------------------------------
Looking to filter a database on a date field. Is this possible. I'm
having trouble doing so.
SFilter being a string input date in the format 18/10/1953
UK/Ireland date format.
Competitors.SetFilterTo('DATES == "'+CTOD(SFilter)+'"');
This line above does not work no matter what way I type it.

Have tried the DTOC function as well as Marie suggested. No Good.
---------------------------------------------

If SFilter is a String then the following sould work.
Competitors.SetFilterTo('DATES == CTOD("'+SFilter+'"))';

On long filter expressions, I have started breaking them into smaller lines.

Var idCheck, BegCheck, EndCheck, Filter : String;
begin
with tzDetailTable
do begin
   idCheck := '(MemNo == "'+frmMainForm.Id+'")';
   BegCheck := '(Date => CTOD("'+frmMainForm.BeginDate+'"))';
   EndCheck := '(Date <= CTOD("'+frmMainForm.EndDate+'"))';
   Filter := IdCheck +' .AND. '+ BegCheck + ' .AND. ' +EndCheck;
   SetFilterTo(Filter);
   end;
end;

Hope this helps.

jw

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
==^================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.