Clientdataset filter iki tarih arasında string sorgulama

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Berdem
Üye
Mesajlar: 431
Kayıt: 28 Tem 2003 12:28

Clientdataset filter iki tarih arasında string sorgulama

Mesaj gönderen Berdem »

Merhaba,

Kod: Tümünü seç

var
  asd: string;
begin
  asd := DBComboBox3.Text;
  DM.gelen_ds.close;
  DM.gelen_ds.CommandText := 'SELECT * FROM gelen where (TARIH between :Tar and :Tari)and (GELDIGIYER=:Tars)order by sirano asc ';
  DM.gelen_ds.ParamByName('Tars').Value := asd;
  DM.gelen_ds.ParamByName('Tar').Value := Datetostr(DateTimePicker7.Date);
  DM.gelen_ds.ParamByName('Tari').Value := Datetostr(DateTimePicker8.Date);
  DM.gelen_ds.Open;
end;
sql çalışan bu kodu table filter yöntemini uygulamak istiyorum.
Bir kaç deneme yaptım yanıt alamadım.Yardımlarınızı bekliyorum.

Kod: Tümünü seç

 dm.gelen_cl.IndexFieldNames := 'TARIH;GELDIGIYER';
  dm.gelen_cl.SetRange[DateToStr(DateTimePicker7.Date), asd], [DateToStr(DateTimePicker7.Date), asd]);

Kod: Tümünü seç

  dm.gelen_cl.FilterOptions:=[foCaseInsensitive];
  dm.gelen_cl.Filter:='GELDIGIYER= ' + asd +' and (TARIH>='+QuotedStr(datetostr(datetimepicker7.Date)) + ' and ' + 'TARIH<='+QuotedStr(datetostr(datetimepicker8.Date))+')';
   dm.gelen_cl.Filtered:=true;

Kod: Tümünü seç

  dm.gelen_cl.Filter:='(TARIH between ''' + DateToStr(DateTimePicker7.Date) + ''' and  '''+ DateToStr(DateTimePicker8.Date) + ''')and GELDIGIYER= ''' + asd + '''';
  dm.gelen_cl.Filtered:=true;
Cevapla