有两个表 temp--字段code,date,time
kq1--字段code,md1(表示上午上班时间),md2(表示上午下班时间),ad1(表示下午上班时间),ad2(表示下午下班时间) 我要把TEMP内的数据按条件导入KQ1内,最主要的是TEMP内的time 要按条件分别导入KQ1内的md1,md2,ad1,ad2
if temptime.Value<'09:00' then
kq1md1.Value:=temptime.Value;
if (attemptime.Value>'09:30') and (attemptime.Value<'13:00') then
kq1md2.Value.Value:=temptime.Value; if (temptime.Value>'12:59') and (temptime.Value<'14:00') then
kq1ad1.Value:=attemptime.Value;
kq1--字段code,md1(表示上午上班时间),md2(表示上午下班时间),ad1(表示下午上班时间),ad2(表示下午下班时间) 我要把TEMP内的数据按条件导入KQ1内,最主要的是TEMP内的time 要按条件分别导入KQ1内的md1,md2,ad1,ad2
if temptime.Value<'09:00' then
kq1md1.Value:=temptime.Value;
if (attemptime.Value>'09:30') and (attemptime.Value<'13:00') then
kq1md2.Value.Value:=temptime.Value; if (temptime.Value>'12:59') and (temptime.Value<'14:00') then
kq1ad1.Value:=attemptime.Value;
可以这样做
1、时间比较 StrToTime
2、String比较 FormatDateTime('hh:mm',...)
呢,就出现这样的 情况
KQ1
CODE DATE MD1 MD2 AD1 AD2 000001 2003-11-22 08:50
000001 2003-11-22 12:00
000001 2003-11-12 13:20
000001 2003-11-12 17:30
我要的是这种情况:
KQ1
CODE DATE MD1 MD2 AD1 AD2 000001 2003-11-22 08:50 12:00 13:20 17:30
应知了吗