delphi(0分)

  • 主题发起人 helpdelphi
  • 开始时间
H

helpdelphi

Unregistered / Unconfirmed
GUEST, unregistred user!
temp :='select * from user_loginlog '+
' where '''+datetostr(uptime)+''' between '''+datetimetostr(datetimepicker1.Date)+''' and '''+datetimetostr(datetimepicker2.Date)+'''';
其中uptime为user_loginlog表中的一个字段,数据类型为日期/时间型.
程序运行错误提示为: datetostr未定义.
 
C

Codemoocow

Unregistered / Unconfirmed
GUEST, unregistred user!
Temp := 'SELECT * FROM user_loginlog WHERE 字段名 BETWEEN ''' + DateTimeToStr(DateTimePicker1.Date) + ''' AND '''+ DateTimeToStr(DateTimePicker2.Date) + ''''
 

淡看江湖路

Unregistered / Unconfirmed
GUEST, unregistred user!
Temp := 'SELECT * FROM user_loginlog WHERE uptime BETWEEN ''' + DateTimeToStr(DateTimePicker1.Date) + ''' AND '''+ DateTimeToStr(DateTimePicker2.Date) + ''''
因为引用的是字段名,不是值
 
X

xiaoping622

Unregistered / Unconfirmed
GUEST, unregistred user!
select * from 表名 where 字段名 between x1 and x2
 

Similar threads

回复
0
查看
797
不得闲
S
回复
0
查看
888
SUNSTONE的Delphi笔记
S
S
回复
0
查看
724
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部