Einzelnen Beitrag anzeigen

danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#22

AW: Filtering two IBTable and insert or edit IBTable

  Alt 5. Mär 2014, 17:18
OK.
Delphi-Quellcode:
var
  sod: TDateTime;
  set_week,start_week,end_week, set_old_week, start_old_week, end_old_week,sec: string;
  begin
(* Filter week *)
  start_week := IntToStr(dayofweek(now -1))+'.'+ IntToStr(myMonth)+'.'+IntToStr(myYear);
  end_week := IntToStr(dayofweek(now -1)+7)+'.'+ IntToStr(myMonth)+'.'+IntToStr(myYear);

  set_week := '("WHEN" >= ' + QuotedStr(start_week)
              + ') and ("WHEN" <= ' + QuotedStr(end_week)
              + ')';

  (* Filter old week *)
  sod := StrToDate(start_week) -7;
  sec := DateToStr(sod);

  start_old_week := sec;
  end_old_week := start_week;

  set_old_week := '("WHEN" >= ' + QuotedStr(start_old_week)
              + ') and ("WHEN" <= ' + QuotedStr(end_old_week)
              + ')';
.................
Daniel
  Mit Zitat antworten Zitat