ACCEES数据库字段DATE:日期/时间形.
用ADOQUERY查询;adoquery.sql.text:='select * from table where date='''+ComboBox5.Text+'''';运行报错"标准表达式中数据类型不匹配"why?

解决方案 »

  1.   

    adoquery1.sql.text:='select * form table where dd='+strtodate(combobox5.text)+'';\
    adoquery1.open;
      

  2.   

    adoquery.sql.text:='select * from table where date='''+ComboBox5.Text+'''';应改为:adoquery.sql.text:='select * from table where date=#'+ComboBox5.Text+'#';
      

  3.   

    SQL:='select * from table where date=#'+ComboBox5.Text+'#';
      

  4.   

    up
    SQL:='select * from table where date=#'+ComboBox5.Text+'#';
      

  5.   

    我再想问一下各位大侠,就是我用下列语句:
       data1:=datetostr(adoquery1.fieldvalue['date']);
    可结果年为2位的呀,我想得4位怎么办,
    这好像和win的系统时间格式好像有关,我用什么办法能得四位的数据。