title: Apply SQL query condition to multiple columns in VBA
body: <p>Please find my below sample table,where i have applying if condition for multiplying Numerical data.</p>
  
  <p><a href="https://i.stack.imgur.com/o1fhk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o1fhk.png" alt="enter image description here"></a></p>
  
  <p><strong>Query Code</strong></p>
  
  <pre><code>sql_string = "Select [Sheet5$].[num] * IIf(([Sheet5$].[to]-[Sheet5$].[frm])&lt;365, .4," &amp; _
  "IIf(([Sheet5$].[to]-[Sheet5$].[frm])&gt;365, 1, 0)) from [Sheet5$]"
  </code></pre>
  
  <p>Above code will help me out to apply the condition on one column <strong>i.e num</strong> only.But i want to apply it on multiple columns around 20-30 columns which is available in my actual data.it is possible to mention column names but it is  not possible to write the above <strong>if condition</strong> to each column. please guide me on the same.</p>