Purchase Solution

Using a semicolon (;) in MS Access

Not what you're looking for?

Ask Custom Question

I notice when writing queries that Access will add in a semicolon at the end of my query. Its just one of those Access things right? We don't have to remember to write the semicolon, as Access adds it in for us correct.

The only time this is significant to know is in a situation like this - in a UNION query We may end up cutting and pasting code from 2 queries together, like this:

So does that mean if we wanted to use a semicolon in our query search
string, we would have to enclose it like you do an asterisk [;], or is
using the double quotes enough?

For example:
SELECT *
FROM TABLE1
UNION
SELECT *
FROM TABLE2

if you were to accidentally do this:
SELECT *
FROM TABLE1; (<- leave in the semicolon from the first query)
UNION
SELECT *
FROM TABLE2;

Then your query wouldn't run. You can only have one semicolon in a query in Access, and it has to be at the end.

Purchase this Solution

Solution Summary

In SQL a semicolon (;) is intended to end a SQL statement. MS Access handles this a bit differently. This solution briefly explains how MS Access handles the ; and explains the advantages of using a ; the way it was intended.

Solution Preview

Yes, Access will (depending on the version you are using) add the semicolon for you as well as reformat your query (in some cases).

The ";" is supposed to mark the end of the query. In that case the union query that you are showing should fail. Instead, ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.