Browse » Home
Friday, November 25, 2011
How to Create a Searchable Database in Excel
1. Type the following data into a new spreadsheet, pressing 'Tab' in place of the commas. This data is for a hypothetical art supply store. Click your mouse on the data's top left cell, then drag down to the bottom right cell to select the data. Type 'ArtProducts' in the left text box above the worksheet grid. This action names the table, which makes it easier to identify in database queries.product, pricepaintbrush, 1.98Gesso, 3.45
2. Click the 'File' menu's 'Close' command, then click 'OK' to indicate you want to save the workbook. Type 'ArtProduct' for the file name, then click 'Save' to save the workbook. Click the 'File' menu's 'New' command to create a new workbook, then click the 'Data' tab's 'Other sources' icon. Click 'Microsoft query.'
3. Click 'Excel files' in the 'Choose data' dialog box, then click 'OK.' Microsoft query will display a dialog box with which to choose an Excel workbook file. Navigate to and double click the workbook you saved in the previous step, then click 'OK.'
4. Click the arrow button in the 'Columns' dialog box to tell Excel you want to base your query on the 'ArtProduct' database listed in the left pane. Click 'Next,' then click the 'View data' option button. Microsoft Query's main window will open.
5. Click the 'View' menu's 'SQL' command, then type the SQL statement following this step into the new dialog box. This statement runs a query on your 'ArtProducts' database to select only those products whose price is greater than $2.00. Click 'OK' to perform the query. Excel will display only the 'Gesso' product, confirming that you've created an Excel database whose records you can selectively search with SQL commands from querying programs like Microsoft Query.SELECT *FROM ArtProductswhere ArtProducts.price>2.00;