title: Executing a SQL query from vba results with nothing
body: <p>Cheers,
  I am trying to send a simple SQL query, but I get no results in my recordset as if it simply was not executed.
  Just after, I am executing a different query, which results correctly.
  When running the same query from SMSS, do brings up the desired results.</p>
  <p>Following is the code:</p>
  <pre><code>If CheckLogsFromRestartDay = True Then
     'This line does NOT seem to work. Nothing is changed in the Recordset
     Set objMyRecordset = objMyConn.Execute( _
   &quot; SELECT top 1 cast(tValue AS date) AS RestartDate &quot; &amp; _
   &quot; FROM settings (nolock) WHERE tkey = 'EngineStartTime' &quot;) 
  
     'This line DOES provide an answer correctly
     Set objMyRecordset = objMyConn.Execute( _
    &quot; SELECT * FROM &quot; &amp; LogTable &amp; &quot; (nolock) where Webpage like 'Engines%'&quot; &amp; _
    &quot; ORDER BY id desc&quot;) 
  
     sTodayMMDD = objMyRecordset!RestartDate
  Else
     sTodayMMDD = Format(Date, &quot;yyyy-mm-dd&quot;)
  End If
  </code></pre>