Monday, July 20, 2009

Adding Parameters to SQL Queries

At some point you'll want to be able to select your data using entries on a spreadsheet. That's where data parameters come in. It's a lot more complicated to explain than to actually use.

1. right click on the query data, click edit query. Add your criteria to the query, just add something like fsono = '002100'. Click the SQL button, replace '002100' with ? . this will generate a prompt that will ask for the fsono(for this example) when you refresh the data.

2. exit the query, and return to the spreadsheet. Enter the fsono that you want in a separate cell on the spreadsheet.

3. right click in the query data and click parameters. click the third option, Get the value from the following cell, and choose the cell where you put the fsono.

4. click OK, you're on your way!