title: VBA MS Access Getting the start date in a database
body: <p>I have a MS Access database and inside it I import tables from an external source every month.  What I want to do is get the earliest date in the database since it is out of order.  I am creating forms and so far this is what I have:</p>
  
  <pre><code>'Get start and end date
  Dim DBGeo As DAO.Database
  Dim rstStartDate As DAO.Recordset
  
  Set DBGeo = CurrentDb
  
  varStartDate = "SELECT [time] FROM [" &amp; cboTableName &amp; "] ORDER BY [time] ASC LIMIT 1;"
  MsgBox (varStartDate)
  Set rstStartDate = DBGeo.OpenRecordset(varStartDate, dbOpenSnapshot)
  </code></pre>
  
  <p>The field name is called time and I know that is a keyword but I dont want to change it or else I have to change it in all the tables.  CboTableName has the name of the table I am using.  </p>
  
  <p>Im not great at this stuff so I am sure it is something simple.  Thank you</p>