用的是access
我已经获取了一个当前时间COleDateTime dtTime;  dtTime = COleDateTime::GetCurrentTime();  
然后把当前的年,月,日分别存在m_curYear,m_curMonth,m_curDay中
我希望能在表中查询出与当前的日期相等的那一个或若干个记录,表中记录日期的字段名是“date”,是日期/时间类型的。
请教各位高手,该怎么处理,急~~~

解决方案 »

  1.   

    COleDateTime start;
    COleDateTime end;
    s = start.Format("%Y-%m-%d %H:%M:%S");
    e = end.Format("%Y-%m-%d %H:%M:%S");
       
    sql.Format("select * from OutCord where OutTime>=#%s# and OutTime<=#%s#",s,e);
      

  2.   

    CString strSql;
    strSql.Format( "select date from table where format(date,'yyyy-mm-dd') = '%04d-%02d-%02d'",m_curYear,m_curMonth,m_curDay );