title: Change of original column leads to TEXT format in Excel sheet
body: <p>This select in EXCEL VBA results to <strong>numeric</strong> format in Excel:</p>
  
  <pre><code>strSQL = "SELECT * FROM OPENQUERY(dtb, 'SELECT col from table')"
  </code></pre>
  
  <p>But if I make some function on the column, it results as <strong>text</strong> format in Excel:</p>
  
  <pre><code>strSQL = "SELECT * FROM OPENQUERY(dtb, 'SELECT sum(col) from table')"
  strSQL = "SELECT * FROM OPENQUERY(dtb, 'SELECT col*1.0  from table')"
  strSQL = "SELECT * FROM OPENQUERY(dtb, 'SELECT col-1    from table')"
  </code></pre>
  
  <p>I've tried <code>to_number(...)</code>, <code>to_number(to_char(...))</code> but it didn't helped. </p>
  
  <p>Why? How can I resolve this situation?</p>
  
  <p><strong>SOLUTION</strong> (convert column to numeric using SQL server cast function)</p>
  
  <pre><code>strSQL = "SELECT cast(col# as numeric(10, 2)) col# " _
           "FROM OPENQUERY(dtb, 'SELECT sum(col) col# from table')"
  </code></pre>