Commenting SQL code in Union query

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

How to comment SQL code in a Union Query or
any query for that matter.

I tried help but couldnt seem to find the answer to this
one.
 
tom said:
How to comment SQL code in a Union Query or
any query for that matter.

I tried help but couldnt seem to find the answer to this
one.

As far as I know that isn't possible with Access queries, except for
right clicking the query in the database window, select properties,
and "document" in the description property.
 
tom said:
How to comment SQL code in a Union Query or
any query for that matter.

I tried help but couldnt seem to find the answer to this
one.

AFAIK there is no way to put comments into the SQL code for any Access
query. The only possibility I see ist to use the Description Property
of the query. For passtrough queries, the server rules should apply,
so it may be possible to include comments.

HTH
Matthias Kläy
 
There really isn't a good way to comment a JET query, but here is a possible
work-around:

Open a table or query's property sheet and type your comments in the
Description property. In the query QBE grid, you can also select a column
and use its Description property. Union queries do not have the QBE grid,
but I always take the constituent parts and save them as separate queries,
like:

qryUnionMain
qryUnionMain1
qryUnionMain2
 
How to comment SQL code in a Union Query or
any query for that matter.

I tried help but couldnt seem to find the answer to this
one.

That's because comments are not supported in JET queries.

The only way is to put in a calculated field containing the comment.

John W. Vinson[MVP]
 
Stephen method works quite nicely, but I would rather copy the SQL into a
text file and comment it as though it were an MS SQL Server view or proc.
That way you can write inline comments. You could even store all of the text
file in a table, but keeping up with changes would be a bear.

Maybe someday, Access will accept comments in queries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top