datetime变量,怎样判断为空值?

北极海hein 2002-09-17 07:54:01
datetime变量,怎样判断为空值
...全文
294 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
ssl2000 2002-09-17
  • 打赏
  • 举报
回复
if Table1.FieldByName('ADate').isnull then
撒加的天使 2002-09-17
  • 打赏
  • 举报
回复
日期格式的转换!

FormatDatetime(格式字符串,tdatetime);

具体可以查帮助
xxyzjf 2002-09-17
  • 打赏
  • 举报
回复
TO:tongding;
謝謝你的提醒.

blazingfire 2002-09-17
  • 打赏
  • 举报
回复
如果是在数据库中为Null的值可以这样判断:
if Table1.FieldByName('ADate').AsString='' then
tongdings 2002-09-17
  • 打赏
  • 举报
回复
to xxyzjf(FaceToFace)
日期有格式模板的,要根据实际考虑,进行判断。
xxyzjf 2002-09-17
  • 打赏
  • 举报
回复
var str:string;
try
str:=datetimetostr(datetimepicker1.datetime);
except
on myerror.econverterror do
showmessage('asjdfjaslkfjas');
end;
tfxg 2002-09-17
  • 打赏
  • 举报
回复
strtofolat(datetimetostr(datetimepicker1.datetime))这样可以找到时间的浮点值
njbudong 2002-09-17
  • 打赏
  • 举报
回复
用转换时用
try
....
except
exit ;
end;
xxyzjf 2002-09-17
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text:=datetimetostr(datetimepicker1.DateTime);
if Edit1.Text='' then
showmessage('null');
end;
在SQL里可以有空的.我想楼主的意思是在数据库中吧!
耙子 2002-09-17
  • 打赏
  • 举报
回复
DateTime 变量不可能为空,它是一个浮点数,浮点数能为空吗?

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧