Update QueryToSelect.cfm

- Fixes bugs in QueryToSelect function
- Adds demo code