Here is the statement. It is returning all 6 records. Any idea what I am doing wrong? CString csQuery = _T(""); csQuery.Format("SELECT TOP 1 * FROM Component_Sched_Tbl WHERE project_id = '%s' AND component_id = '%s' AND component_in_pour = False AND component_issued_date IS NOT NULL ORDER BY component_issued_date DESC", csProjectID, csID);if(m_recToCtrl.OpenRecordset(csQuery)){ int nCount = m_recToCtrl.GetRecordCount(); if(m_recToCtrl.SetFieldValue(_T("component_in_pour"), true)) { //Success!! }
nCount should be equal to 1 since I am asking to select the TOP 1 but it is equal to all the records that meet the "AND" requirements.Any ideas? Mike B