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
London, United Kingdom | MI5
Programme Managers - Project Managers - Project Support Staff   Getting the best out of technology is critical to helping us protect the UK. Join MI5 and use your skills and experience to help us ... more >
London, United Kingdom | MI5
Business Intelligence Specialists - Competitive Salary + Excellent Benefits - London   Getting the best out of technology is critical to helping us protect the UK. Join MI5 and use your skills and experience to ... more >
Reading, Berkshire, United Kingdom | EDS
Job Title Netcool Designer / Engineer Location Reading Short Description: DII The DII project is contracted to supply both hardware and software infrastructure solutions to support the MoD transition to a common base solution, based ... more >
London, United Kingdom | British Museum
Senior Programmer - The British Museum - £40k+ - London   Although steeped in history, the British Museum is constantly striving to improve access to and understanding of one of the world's most diverse collections of antiquities from cultures ... more >
More job opportunities