indate为数据库中字段,为日期型;我把DateTimePicker1.Date转换为字符型后进行比较提示‘表达式中数据类型不匹配’ 请高手们看一下下面的语句该怎么写?
小弟不胜感激。
LODM.ADOQgoodsin.SQL.Text:='select * from googdsininf where indate >'''+DateToStr(DateTimePicker1.Date)+'''';
小弟不胜感激。
LODM.ADOQgoodsin.SQL.Text:='select * from googdsininf where indate >'''+DateToStr(DateTimePicker1.Date)+'''';
Params.ParamValues['indate']:=FormatDateTime('yyyy-mm-dd',DateTimePicker1.Date);
//指定参数类型
LODM.ADOQgoodsin.parameter.paramByName('setDate').DataType := ftDate;
//参数赋值
LODM.ADOQgoodsin.parameter.paramByName('setDate').value := DateTimePicker1.Date;
就好了。