adoquery3.SQL.Add('select * from daa a,oil b where  b.年月='''+trim(f_ny.combobox1.text)+''' and a.mz =c.名称 and c.含水>0.4 ');
daa表
mc      yczmc  
name1   nnoil表
名称     年月       含水
name1    20061131   0.501我就是查询 某一年月中含水 大于0.4 的jh yczmc
查询的结果含有的 字段  :jh   yxzmc   含水我象上面那样写查询结果怎么不对啊

解决方案 »

  1.   

    呵呵,有理,上面都没有c对应的表,你的c哪里来的啊??
    c改成b应该是对的
      

  2.   

    哦 忘记说了啊 
    那个是我新创建的 表(字段名字改了一下)
    他就是  mc  
    mc   yxzmc   含水
      

  3.   

    SQLSTR:='select a.*,b,b.* from daa a,oil b where a.mc=b.mc and  b.年月='''+trim(f_ny.combobox1.text)+''' and a.mz =c.名称 and c.含水>0.4 '
    你当中的C就不清楚是什么了,总之你的数据库设计的问题大大呀
      

  4.   

    adoquery3.SQL.Add('select mc,   yxzmc,   含水 from daa a,oil b where  b.年月='''+trim(f_ny.combobox1.text)+''' and a.mz =b.名称 and b.含水>0.4 ');
      

  5.   

    adoquery3.SQL.Add('select * from daa a,oil b where  b.年月='''+trim(f_ny.combobox1.text)+''' and a.mz =b.名称 and b.含水>0.4 ');mc  yczmc   含水
      

  6.   

    adoquery3.SQL.Add('select mc,   yxzmc,   含水 from daa a,oil b where  b.年月='''+trim(f_ny.combobox1.text)+''' and a.mc =b.名称 and b.含水>0.4 ');
    把mz改成mc
      

  7.   

    我的是dbf表
    看查询结果 跟本不是选择的那个年月下的结果~~~
    还有就是 俩个表关联的也就是 mc和名称  字段了啊 其他的字段没有相同的值,