H
hblyp21
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tsb_rcxhjcgl.N2Click(Sender: TObject);
var
sb,da:string;
begin
case dayofweek(date) of
1: begin
sb:='1899-12-24';
da1:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl where xjsj>='+''''+da1+'''';
clientdataset1.Open;//sunday
end;
2: begin
sb:='1899-12-30';
da2:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl where xjsj>='+''''+da2+'''';
clientdataset1.Open;
end;//monday
3: begin
sb:='1899-12-29';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;//tuesday
end;
4: begin
sb:='1899-12-28';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;//wednesday
end;
5: begin
sb:='1899-12-27';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;
end;//thursday
6: begin
sb:='1899-12-26';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;
end;//friday
7: begin
sb:='1899-12-25';
da2:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;
end;//statusday
end;
end;//以上为根据本周记录,提取系统时间得出星期几来查找
这是原来被人的程序我看了老半天愣没看懂??????请教高人!!!
var
sb,da:string;
begin
case dayofweek(date) of
1: begin
sb:='1899-12-24';
da1:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl where xjsj>='+''''+da1+'''';
clientdataset1.Open;//sunday
end;
2: begin
sb:='1899-12-30';
da2:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl where xjsj>='+''''+da2+'''';
clientdataset1.Open;
end;//monday
3: begin
sb:='1899-12-29';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;//tuesday
end;
4: begin
sb:='1899-12-28';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;//wednesday
end;
5: begin
sb:='1899-12-27';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;
end;//thursday
6: begin
sb:='1899-12-26';
da:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;
end;//friday
7: begin
sb:='1899-12-25';
da2:=datetimetostr(date+strtodatetime(sb));
clientdataset1.Close;
clientdataset1.CommandText:='select * from sb_rcxhjcgl';
clientdataset1.Open;
end;//statusday
end;
end;//以上为根据本周记录,提取系统时间得出星期几来查找
这是原来被人的程序我看了老半天愣没看懂??????请教高人!!!