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
Welwyn Garden City, Hertfordshire, United Kingdom | Tesco.com
Affiliate & Media marketing manager - Welwyn Garden CityWho's behind the world's most successful online retailer? Just over 10 years ago we started Tesco.com (aka Dotcom). Today, we've an incredible 750,000 active customers and sales ... more >
United Kingdom | ESRC
Web/Project Manager - £33,118 to £35,694 + Benefits Cutting-edge research is our business. You'll give us the cutting-edge web technologies to match. The Economic and Social Research Council is the UK's leading research agency for ... more >
Solihull, United Kingdom | Enzen Global Limited
Business Analyst - £30,000 - £35,000 - Solihull We are in need of a Business Analyst with strong analytical skills and a penchant for learning the domain knowledge of the Utilities sector (Gas industry in ... more >
United Kingdom | Advent Computer Training
Are you stuck in a dead end job? Do you want to take control of your salary, life and career? Advent IT and computer training offers advanced, professional training and helps you find the right ... more >
More job opportunities