Recent

Author Topic: Problem with seting FILTER  (Read 2934 times)

ribarvlada

  • New Member
  • *
  • Posts: 20
Problem with seting FILTER
« on: September 01, 2011, 03:02:18 pm »
Data base - Firebird 2.5
ZeosDB 7

When I set filter, from date to date, I can not see any record.
What is wrong with my code
 
 
Code: [Select]
procedure TFormVozila.BitBtnIzvPojStampaClick(Sender: TObject);
var
  cDat1, cDat2, cFilter: string;
begin
  cDat1:=DateToStr(ZVDateTimePickerIzvOdDatuma.Date);
  cDat2:=DateToStr(ZVDateTimePickerIzvDoDatuma.Date);
  RLLabelIzvPojOdDatuma.Caption:=cDat1;
  RLLabelIzvPojDoDatuma.Caption:=cDat2;
  cFilter:='(DATUMPOLASKA>='+cDat1+') and (DATUMPOLASKA<='+cDat2+') and (REGBR='+QuotedStr(EditIzvRegBr.Caption)+')';
  ZQueryNalog.Filter:=cFilter;
  ZQueryNalog.Filtered:=True;
  ZQueryNalog.First;
  RLReportPojedina.Preview(NIL);
  RLReportPojedina.ClosePreview;
  RLReportPojedina.Visible:=False;
end;

where DATUMPOLASKA is field Date type at table NALOG?

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Problem with seting FILTER
« Reply #1 on: September 01, 2011, 05:45:35 pm »
I would test by debugging the variable cFilter and see if it looks correct. That looks complicated.

 

TinyPortal © 2005-2018