Computer Science Homework Solutions
Problem
#132585

Queries in Access

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.


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
What is this?
By OTA - Overall OTA Rating
Mike Noel, MS - 4.9/5
Purchase Cost Now
$2.19 CAD (was ~$7.98)
Included in Download
  • Plain text response
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse