SQL to VBA Conversion

>>>

How it works . . .

The functionality on this page is written in Javascript - The original tool is of course written in vba inside an access database where many similar tools exist.

function outputListFields() {

     var sql = document.getElementById("sql-input").value;

     // Remove Select Statement
     sql = sql.replace(/Select/i, "");       // i=case insensitive

     // Remove From and any remaining text
     sql = sql.replace(/From(.+)/i, "");     // (.+) period stands from any character + means any quantity  

     // Remove Whitespace+Tablename+Period
     sql = sql.replace(/\s.*?\./g, "");

     // Replace comma with newline
     sql = sql.replace(/\,/g, "\n");

     document.getElementById("vba-output").value = sql;
 }