title: Call function for specifying columns in SQL TRANSFORM query
body: <p>Here is my query:</p>
  
  <pre><code>PARAMETERS ...
  TRANSFORM ...
  SELECT ...
  ...
  PIVOT Mytable.type In ("Other","Info");
  </code></pre>
  
  <p>This is a cross query and I need to set all the column headings with this row: <code>PIVOT Mytable.type In ("Other","Info")</code> and now I have hard-coded the headings, <strong>Other</strong> and <strong>Info</strong>.</p>
  
  <p>But I want to do this dynamically. So what I want to do is to call a vba-function that returns all the headings I need.</p>
  
  <p>Something like this:</p>
  
  <pre><code>PIVOT Mytable.type In (myVbaFunction());
  </code></pre>
  
  <p>So my question is: How to call a vba-function inside the sql-query?</p>