查询分析器执行
select in_no as 进货单号,in_date as 进货日期,vwindetail.wzdm as 商品代码,mcname as 商品名称,in_sl as 进货数量,cun.sl as 物流仓库即时库存量 from vwindetail left join cun on cun.wzdm=vwindetail.wzdm where cun.ckdm='0005' and mcname like '%x)' and (in_date>'2005-12-23' and in_date<'2005-12-24') order by vwindetail.in_date 显示没有12-24的数据在DELPHI里用QUERY,
最后一条却显示12-24的数据,实际12-24数据有很多
问题:为何会有12-24的数据?

解决方案 »

  1.   

    in_date>'2005-12-23 00:00:00' and in_date<'2005-12-24 00:00:00'
    要精确!就对了,日期格式要弄清
      

  2.   

    select in_no as 进货单号,in_date as 进货日期,vwindetail.wzdm as 商品代码,mcname as 商品名称,in_sl as 进货数量,cun.sl as 物流仓库即时库存量 from vwindetail left join cun on cun.wzdm=vwindetail.wzdm where cun.ckdm='0005' and mcname like '%x)' and (in_date>'2005-12-23' and in_date<='2005-12-24') order by vwindetail.in_date 1.in_date<='2005-12-24')
      

  3.   

    最好使用参数, in_date > :VBinDate and in_date < :VEndDate
    然后在参数中赋值就行了.
      

  4.   

    in_date>'2005-12-23' and in_date<'2005-12-24'
    这样就是可以的,它默认的就是  00:00:00。应该是其它条件的问题。
    在delphi中,看看是否有写的有不对的地方。
      

  5.   

    zxf_feng(阿日) 说的没错,
    上面SQL错了,变成多对多关系了,所以异常,
    我改为1对多,就正确了,