Commentary in Queries

Reese

Registered User.
Local time
Today, 16:36
Joined
Jan 13, 2013
Messages
387
[Solved] Commentary in Queries

I know that you can insert comments and notes in VBA code using a singular quote, like the following:

Code:
'Comment about what the code does
Is there a similar way to insert comments in the SQL of queries? I found other forum posts that say this isn't possible but those were all for pre-2010 Access. Has this changed at all? Thanks.
 
Last edited:
Not changed as far as I am aware, although now-a-days you can put a description on any object that may allow you to put some note there.... though it isnt in the SQL ...
 
Not changed as far as I am aware
I thought that might be case.

now-a-days you can put a description on any object that may allow you to put some note there

That would be great. Do you know how I can do that?
 
This is actually what I think of as "database documentation, and it applies to all levels of the dbs objects.

there is no real easy way to annotate the use of objects. In A2003 you had a "description" but it was quite clumsy to use, and I don't think it is there any more.

even with fields in a table, there is no really easy general note facility, as the "description" there prints out on the status line by default, which is often not a good idea.

A very good point, OP
 
As others have mentioned no, but it's been asked for a lot by MVPs at meetings with MS. SQL Server has it, why can't Access?
 
Thanks guys. I had a feeling that "no." Would be the answer.

And, yes, this is part of database documentation. I was just hoping to be able to identify and comment on individual aspects of query code.

For example, I have a query that identifies program payments that are overdue. Certain types of programs we do not charge for (donations, career day events at schools, etc.). I have used WHERE statements to eliminate records of those types of programs but I was hoping to identify each line in the WHERE statement and what it was for. Something like the following:

Code:
WHERE (--Selects only unpaid programs--
([Event Information].Paid Is Null
    Or [Event Information].Paid="0")
--Selects only programs that we charge for--
AND ([Event Information].Cost_Category="Full Price"
    Or [Event Information].Cost_Category="Discount")
)

Oh well. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom