title: comparing an int variable to MSSQL query results Python via pymssql
body: <p>I'm trying to compare a variable to query results in the following which are dates in yyyymmdd format. The database field LastUpdate is of type int.</p>
  
  <p>When I test this, I think I am getting the false result because the query is a tuple compared to my variable as int. </p>
  
  <p>Is there a way to convert the (20160422,) to an int?</p>
  
  <pre><code>import pymssql
  
  conn = pymssql.connect(server='', user='', password='', database='')
  
  cur = conn.cursor()
  cur.execute('SELECT Top 1 LastUpdate FROM tbl_Date')
  
  myDate = 20160422
  
  for row in cur:
      print(row)
  
      if row == myDate:
          print('true')
          #then do something
      else:
          print('false')
  
  conn.close()
  </code></pre>