Microsoft Access is designed such that even if you do not know SQL or SQL syntax you could still use the application. As a consequence, there is no obvious starting point to write a SQL Statement and execute it. However, it does allow you to write a SQL Statement, save the query and execute it.
Open access application. I have just one simple table 'BOOK1'.
In the 'Queries' tab of Create click on Query Design to open a tabbed page 'Query 1" as shown.
Right-click in the empty top pane to show this drop-down.
Click on 'SQL View'. This view is not the same as 'View' in SQL Server. This opens a text editor where you can write a query. Note that it has just the 'SELECT'. It expects you to write a "SELECT" statement.
Now I write a SQL query against this table.
SELECT ID, Field2
From Book1
Here is the statement in the SQL View's editor pane.
You can save it with a different name which is usually recommended. I saved it as BookQry as shown.
No comments:
Post a Comment