1 please notice this :CTime::Format
write the sql statement like this
sqltext.Format("select * from table1 where time between %s and
%s",m_time1.Format( LPCTSTR pFormat ),m_time2.Format( LPCTSTR pFormat ));
或者
sqltext.Format("select * from table1 where time 〉 %s and time <
%s",m_time1.Format( LPCTSTR pFormat ),m_time2.Format( LPCTSTR pFormat ));2 在vc中时间可否这样来比较?
这是sql 中的时间比较与VC无关,支不支持要看DATABASE ,
SQL SERVER IS OK
ACCESS I don't known
maybe you can do a test in access queries tools
write the sql statement like this
sqltext.Format("select * from table1 where time between %s and
%s",m_time1.Format( LPCTSTR pFormat ),m_time2.Format( LPCTSTR pFormat ));
或者
sqltext.Format("select * from table1 where time 〉 %s and time <
%s",m_time1.Format( LPCTSTR pFormat ),m_time2.Format( LPCTSTR pFormat ));2 在vc中时间可否这样来比较?
这是sql 中的时间比较与VC无关,支不支持要看DATABASE ,
SQL SERVER IS OK
ACCESS I don't known
maybe you can do a test in access queries tools
sqltext.Format("select * from table1 where time > #%s# and time <
#%s# ",m_time1.Format("%Y-%m-%d"),m_time2.Format("%Y-%m-%d"));
注意在ACCESS中sql 语句在时间的前后要加上#号,在SQL SERVER 则不用.时间可以用<>=进行比较