How do you comment an MS-access Query?

Varun Mahajan picture Varun Mahajan · Oct 31, 2008 · Viewed 138k times · Source

How does one add a comment to an MS Access Query, to provide a description of what it does?

Once added, how can one retrieve such comments programmatically?

Answer

Dan picture Dan · Jan 22, 2015

I decided to add a condition to the Where Clause that always evaluates true but allows the coder to find your comment.

Select
   ...
From
   ...
Where
   ....
   And "Comment: FYI, Access doesn't support normal comments!"<>""

The last line always evaluates to true so it doesn't affect the data returned but allows you to leave a comment for the next guy.