日期查询 access的话: sql.add('select * from table1 where 日期=#'+edit1.text+'#');
上面已经解释的很清楚了,再不看看帮助:procedure DateTimeToString(var Result: string; const Format: string; DateTime: TDateTime);DescriptionDateTimeToString converts the TDateTime value given by DateTime using the format string given by Format into the string variable given by Result. For Formats supported, refer to see Date-Time format strings.呵呵一样的。哈哈
DateTimeToString 方法将TDateTime类型的参数DateTime 按照由参数Format提供的格式
转化成字符串,并保存在Result中。
对于Format的格式类型,请看 Date-Time format strings 的帮助。 例如:
DateTimeToString(result,'yyyy mm dd',now());
那么 result的结果为:2003 03 19 10:50:49
●function DateToStr(Date: TDateTime): string; 描述:
使用 DateToStr 函数能得到 TDateTime 日期时间类型的日期部分。日期的转换格式依赖于
全局变量 ShortDateFormat。TimeToStr
access的话:
sql.add('select * from table1 where 日期=#'+edit1.text+'#');