oracle| Solution | data
CREATE TABLE Worklog_a (
Man_bar CHAR (8) Not NULL,
Man_name VARCHAR2 is not NULL,
MAN_DEP VARCHAR2 () not NULL,
Log_time Date not NULL
Status VARCHAR2 (40)
);
CREATE Unique INDEX Worklog_a_index
On Workman (Man_bar,man_name);
Comment on table worklog_a is
' Log on to the diary list ';
sql:= ' Select Man_bar as "attendance bar code", Man_name as "name", Log_time as "registration time", status as "status", MAN_DEP as "subordinate department";
sql:=sql+ ' from worklog_a where man_bar= ' + ' ' +s11+ '
+ ' and (To_char trunc (log_time, ' + ' ', ' dd ' + ') ' + ', ' + ' ' yyyy-mm-dd ' + ') between '
+ "+getdatestr" (DAT1. Date) + ' ' + ' and ' + ' + ' +getdatestr (dat2. Date) + ';
sql:=sql+ ') Order by log_time Desc ';
RunSQL (ado_pall,sql,0);
Function Tfrmain.getdatestr (dat:tdatetime): string;
var
year, Month, Day:word
Begin
Decodedate (dat,year,month,day);
if (month>=10) then
result:= inttostr (year) + '-' +inttostr ( Month)
Else
result:= inttostr (year) + '-' + ' 0 ' + inttostr ( Month);
if (day>=10) then
result:=result+ '-' +inttostr (day)
Else
result:=result+ '-' + ' 0 ' +inttostr (day);
End;
sql1:= ' INSERT into worklog_a values (';
sql1:=sql1+ ' +s1+ ', ' + ', ' + ', ' +s2+ ', ' + ', ' + ', ' +s3+ ', ' + ', ';
sql1:=sql1+ ' sysdate ' + ', ' + ' ' +kk+ ' ' + ') ';
RunSQL (ado_kqlog,sql1,1);
Statusbar1.simpletext:= ' Today's total: ' +inttostr (ADO_TM. recordcount+1) + ' attendance ';