如何在SQL中按时间段查询数据
sql server:
select * from 表 where 发生日期>'2019/1/17' and 发生日期#2019/1/17# and 发生日期Requery(0); m_Grid.DeleteAllItems(); int i = 0; while (!m_Ado.m_pRecordset->adoEOF) { m_Grid.InsertItem(i, _T("")); m_Grid.SetItemText(i, 0, (_bstr_t)m_Ado.m_pRecordset->GetCollect("ID")); m_Grid.SetItemText(i, 1, (_bstr_t)m_Ado.m_pRecordset->GetCollect("bucket_number")); m_Grid.SetItemText(i, 2, (_bstr_t)m_Ado.m_pRecordset->GetCollect("side")); m_Grid.SetItemText(i, 3, (_bstr_t)m_Ado.m_pRecordset->GetCollect("position")); m_Grid.SetItemText(i, 4, (_bstr_t)m_Ado.m_pRecordset->GetCollect("data")); m_Grid.SetItemText(i, 5, (_bstr_t)m_Ado.m_pRecordset->GetCollect("data_result")); m_Grid.SetItemText(i, 6, (_bstr_t)m_Ado.m_pRecordset->GetCollect("save_time")); m_Ado.m_pRecordset->MoveNext();//将记录集指针移 i++; } m_Ado.CloseRecordset(); m_Ado.CloseConn(); }