The PlainParameter Query is a normal parameter Query without any extensions to the WHERE clause
R E L A T E D   C O N T E N T
ADVERTISEMENT

Hands on: Taking a structured approach

Learn how a little SQL can go a very long way

Mark Whitehorn, Personal Computer World 22 Nov 2007
ADVERTISEMENT

Access has a great graphical query builder, which blew the socks off the opposition when first implemented and continues to provide an extremely efficient way of writing queries. One excellent feature is that it can show you the SQL code that equates to a query you’ve built graphically (choose SQL View from the first button in the bar during query design).

SQL (Structured Query Language) is another highly useful querying tool, even more flexible than the query builder. Knowing a little SQL can greatly extend your query-building skills.

As we run through these example queries, note that if you write one as shown and save it, Access will sometimes rewrite it for you. It will run either way - it’s just that Access’ version is more verbose and bracket-strewn.

SELECT queries
Very often, queries simply reduce the volume of data that we pull back from a table. Imagine a table of 20 fields (columns) and 1,000 rows. A SELECT query can reduce the number of columns we see in the answer table rows using this syntax in SQL:
SELECT (column name 1, column
name 2)
FROM (table name);

and, as an example,

SELECT FirstName, LastName
FROM People;

This selects two columns, FirstName and LastName, from the People table. You can also include the table name in the SELECT line:

SELECT People.FirstName,
People.LastName
FROM People;

This is the more verbose syntax displayed by Access if you create this query in the builder. The answer table contains a subset of columns from the original table. To reduce the number of rows, we add a filter by means of a WHERE clause.

For example, if we want to see just the rows where the entry in FirstName is Bill:

SELECT People.FirstName,
People.LastName
FROM People
WHERE (((People.
FirstName)=”Bill”));

Access is also mighty free with its brackets, as you can see above. In fact, none are obligatory and the last line also works written thus:
WHERE People.FirstName=”Bill”;
or even:
WHERE FirstName=”Bill”;


All Software Applications
Tags: Databases

Like this story? Spread the news by clicking below:

Post this to Delicious del.icio.us    Post this to Digg Digg this    Post this to reddit reddit!

Permalink for this story
R E A D E R   C O M M E N T S
M A R K E T P L A C E
Get your free demo of Numara Track-It! 8 - the leading help desk solution for IT related issues.
Make presentations, review documents & share your entire desktop. 30-day free trial! (cc required).
Discover how remote support can fuel your IT business in ways you've never thought of before.
Apply ITIL best practices at your service desk while eliminating integration cost. Learn more here.
WAN based, automated, daily vulnerability assessments. Click here to try and request our whitepapers.
Have your product or service listed here >   
Sponsored links
F E A T U R E D   J O B S
| Aston Carter
C++ Market Data Developer - Unix - Java - SQL My client are a top financial software house based in the city. They are currently seeking a C++ developer to work in their market data ... more >
| Aston Carter
Junior Python Developer - SQL - Functional Programming - Javascript - Django - Perl - Ruby - MVC My client are a startup software house that specialise in online gaming. The team is small and ... more >
| Aston Carter
Required: Salesforce CRM, Excel My client are Britain's leading financial spread betting firm and are the world's leading trading platform for private investors. This is an excellent opportunity for Salesforce Administrator to join a leading ... more >
| Aston Carter
C# Developer, Hedge Fund, Algo Trading, London The role is working for a boutique derivatives trading company who focus on options high frequency algorithmic trading. They are looking for a bright junior Microsoft .net developer ... more >
More job opportunities