ACCESS:
"select * from 报表 where  日期 like #" & Format(CDate(txtMonth)) & "# "
---------------------------------------------
SQL SERVER:
"select * from 报表 where  日期 like '" & Format(CDate(txtMonth)) & "' "

解决方案 »

  1.   

    select * from 报表 where  month(日期) =month('Format(CDate(txtMonth))' )  and  year(日期) =year('Format(CDate(txtMonth))' ) "
      
    *****************************************************************************
    欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码) 
    http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    ACCESS:
    "select * from 报表 where  日期 like #" & Format(CDate(txtMonth),"yyyy-MM-dd") & "# "
    ---------------------------------------------
    SQL SERVER:
    "select * from 报表 where  日期 like '" & Format(CDate(txtMonth)."yyyy-MM-dd") & "' "