inline sql comments in access 2007 ?

  • Thread starter Thread starter matrix8
  • Start date Start date
There is no way to add comments to SQL statements in Access - unless you
are using a passthrough query.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Do you mean in code?

I use:

currentdb.Execute "update tblCustomers set City = 'New York' where City =
'N.Y.'"

The above is the general approach for action (update quires>

You might want to expand on what you meaning to do here, but, the above
generally the way we do this...
 
for example I'd like to add comments like

** the purpose of this sql query is xyx . . .

SELECT DISTINCT G.elect_name, G.elect_date, G.elect_amt, H.unit_top_up
FROM elect AS G, unit AS H
WHERE G.elect_date =

( SELECT MAX( X.elect_date )
FROM elect AS X
WHERE X.elect_name = G.elect_name
and X.elect_date < Now() Or X.elect_date =
Now()

)

and G.elect_name = H.unit_name

and H.unit_top_up = '15th';
 
what is the syntax to apply inline sql comments in access 2007 ?

There is none, unfortunately. There are some kludgy getarounds but IME they're
more hassle than they're worth.
 
Hi,

How about in the query's Description item in the query's properties list?

Clifford Bass
 
matrix8 said:
for example I'd like to add comments like

** the purpose of this sql query is xyx . . .

Thanks, I 100% miss read your question. I though you were asking for
in-line sql...not in-line comments!!!

My Sorry....

No, there not a comments section. You can use the "description" property of
a saved sql query. You not see this description unless you change the view
to display details for the objects in question (form, reports or in your
case query..).
 
for example I'd like to add comments like

** the purpose of this sql query is xyx . . .

Jet saved QueryDefs do not support comments of any kind within the
SQL. You might consider putting your comments in the query's
Description field, which is accessible by right clicking the saved
query and choosing Properties. I don't know if this is accessible in
code or not, though, but you needn't worry about that unless you
need it in code.
 
Back
Top