A,B 做關聯
where 客户号=" & ff  & "and 日期 between #" & DTPfrom.value & "# and # " & DTPto.Value & "#"

解决方案 »

  1.   

    程序里没有空格没有空格的,  to whose() :关联已成功,后半部分结果不对,急............
      

  2.   

    and # " & DTPto.Value 这里似乎还多了一个空格,不知结果是否受影响还有个人感觉不推荐使用between and 
    我喜欢用>=  <=
      

  3.   

    where 客户号=" & ff  & " and 日期>=#" & DTPfrom.Value & "# and 日期<=#" & DTPto.Value & "#"
      

  4.   

    "select *  from A,B where A.单号=B.单号 and 客户号=" & "'" & ff & "'"  & "and 日期 between" & "#" & DTPfrom.value & "#" & "and " & "#" & DTPto.Value & "#"ff位客户号,字符型的要用单引号扩起来,日期型的也要使用#号,#号也要注意写法
      

  5.   

    select *  from A,B where A.单号=B.单号 and 客户号=" & ff  & "and cast(日期 as date) between #" & DTPfrom.value & "# and # " & DTPto.Value & "#"
      

  6.   

    把日期用format()函数进行格式化,问题就可以解决了。
      

  7.   

    "select * from A,B where A.单号=B.单号 and A.客户号=" & ff & " and A.日期 between #" & DTPfrom.value & "# and # " & DTPto.Value & "#"
      

  8.   

    wufang(牛牛),传你的MDB文件给我[email protected] 只要这个表我来测试 
      

  9.   

    : progame(来来往往,不知所云.......)    已发了,请看看吧
      

  10.   

    你查一下下面这条语句select * from 采购订单表,采购订单明细表
     where 采购订单表.订单号=采购订单明细表.订单号 
      and 供应商编号=1  and 
          日期 between #2001-11-01#  and  #2001-11-22#
      

  11.   

    "select *  from A join B on  A.单号=B.单号 where 客户号=" & ff  & "and 日期 between #" & DTPfrom.value & "# and # " & DTPto.Value & "#"
    请试一下行吗?
      

  12.   

    : progame(来来往往,不知所云.......)     照你的方法在11月份的记录没问题,但何故12有份的那条记录总不能显示,帮忙再看一下好吗?
    zlq78(再见理想) 
       你的方法我会试一试,不过我觉得和表的联结应没关系,因为已联成功了
      

  13.   

    ok 加分了 
    progame(来来往往,不知所云.......)  请收信,