{起月起日查询} if (StrToInt(Trim(ADOQuery_temp.FieldValues['qiyue']))=2) and (StrToInt(Trim(ADOQuery_temp.FieldValues['qiri']))=29) then begin if DaysInAMonth(strtoint(Trim(Edit_niandu.Text)), 2)=28 then begin kaishiriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+Trim(ADOQuery_temp.FieldValues['qiyue'])+'-'+'28' end else begin kaishiriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+Trim(ADOQuery_temp.FieldValues['qiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['qiri']); end; end; if (StrToInt(Trim(ADOQuery_temp.FieldValues['qiyue']))<>2) and (StrToInt(Trim(ADOQuery_temp.FieldValues['qiri']))<>29) then begin kaishiriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+Trim(ADOQuery_temp.FieldValues['qiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['qiri']); end; {止月止日查询} if (StrToInt(Trim(ADOQuery_temp.FieldValues['zhiyue']))=2) and (StrToInt(Trim(ADOQuery_temp.FieldValues['zhiri']))=29) then begin //查询当月的月份天数 //瑞年 if DaysInAMonth(strtoint(Trim(Edit_niandu.Text)), 2)=28 then begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text))+1)+'-'+Trim(ADOQuery_temp.FieldValues['zhiyue'])+'-'+'28'; end //平年 else begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text))+1)+'-'+Trim(ADOQuery_temp.FieldValues['zhiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['zhiri']); end; end else begin if (StrToInt(Trim(ADOQuery_temp.FieldValues['qiyue']))=1) and (StrToInt(Trim(ADOQuery_temp.FieldValues['qiri']))=1) then begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+'12'+'-'+'31'; end else begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text))+1)+'-'+Trim(ADOQuery_temp.FieldValues['zhiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['zhiri']); end; end;