我想打印当天的报表数据
sql上怎么写的
select * from dd where ccrq=getdate
单什么都不出来阿
是不是日期的格式不对
ccrq的格式是yyyy-mm-dd
如果是
请问怎么改

解决方案 »

  1.   

    select * from dd where ccrq= #"& format(getdate,"yyyy-mm-dd") &"#
      

  2.   

    你是sql server数据库吧,我记得,用这个sql语句:
    "select * from dd where ccrq='"& getdate & "'"
    如果是access则:
    "select * from dd where ccrq=#"& getdate & "#"
      

  3.   

    总是有人,把一个日期型变量试图连接到字符串,要知道,sql语句是字符串!用&连接的也只能是字符串。
      

  4.   

    我是在command中的属性用的
    slect * from dd where ccrq=getdate()
      

  5.   

    看你这样行不,
    select * from dd where datediff(yyyy,ccrq,getdate())=0 and datediff(mm,ccrq,getdate())=0 and datediff(dd,ccrq,getdate())
    试试看