标题:如何实现日期的比较?
只看楼主
qpfmates
Rank: 1
等 级:新手上路
帖 子:409
专家分:0
注 册:2008-9-20
结帖率:100%
 问题点数:0 回复次数:1 
如何实现日期的比较?
我在做图书管理系统,判断是否超期,要比较时间,如何实现?望高手指点
搜索更多相关主题的帖子: 管理系统 图书 如何 
2008-10-19 13:22
ruanjian2110
Rank: 3Rank: 3
来 自:武汉
等 级:论坛游民
威 望:7
帖 子:486
专家分:50
注 册:2008-5-25
得分:0 
放两个DateTimePicker控件进行比较就行了,我以前做过类似的,给点代码你参考下。。
if CheckBoxtime.Checked=true   then
   begin
     if DateTimePicker1.DateTime>DateTimePicker2.DateTime then
       begin showmessage('查询时间有误,请正确选择查询时间!');exit;end;
   end;
 if CheckBoxtime.Checked=true   then
   begin
     if DateTimePicker1.DateTime<DateTimePicker2.DateTime then
      begin
      wherestr:=wherestr+' ( ReTime>='''+datetimetostr(DateTimePicker1.DateTime)+''' and ReTime<='''+datetimetostr(DateTimePicker2.DateTime)+''')';
      wherestr1:='and';
      end;
   end;

武汉信控科技有限公司:http://www. 超越技术,本身就是一个美好技术。。。。。。
2008-10-21 10:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-239179-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.647452 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved