Query1.Close;
Query1.SQL.Clear ;
Query1.SQL.Add('select count(*) from 救助服务表 where 填表时间 LIKE ''2003-25%''');
Query1.Prepare;
Query1.Open;
怎么这样写从SQL数据库中查不出个数,一直显示0
在SQL中定义填表时间是datetime型的不知道错在哪里
在表中其它的像姓名可以查询出来
后来我又把填表时间改成CHAR型,可是还是没查出来

解决方案 »

  1.   

    Query1.SQL.Add('select count(*) from 救助服务表 where year(填表时间)=2003 and
    day(填表时间)=25');
      

  2.   

    嘿嘿,真正plmm对程序员来说在电脑里,那才是完美的
      

  3.   

    1
    Query1.Close;
    Query1.SQL.Clear ;
    Query1.SQL.Add('select count(*) from 救助服务表 where convert(varchar,填表时间,112) LIKE ''20030205%''');
    Query1.Prepare;
    Query1.Open;
    2 你查2003年25月的数据?!
    不会吧
    --------------------------------------
    看见了么,
    那支蛾子,
    正飞向太阳,
    那就是我!
    --------------------------------------
      

  4.   

    呵呵   PLMM优先级高?