Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comments in ACCESS 2000 SQL: An Embarrassing Question

Status
Not open for further replies.

JerSand

Technical User
Oct 25, 2000
74
US
I almost always begin a query by using the QBE approach, but then often summon the SQL View in order to enter some adjustments (for instance, "TOP 10" or "DISTINCT," or simply changing the output names when executing aggregate functions). I'd like to be able to enter comments preceding the SQL code, but have found nothing in my SQL books or ACCESS Help that has not created an error in running the query. I've tried these:

/*....*/

--

both at the beginnings and the ends of statements.

I'd be grateful if someone responded with some simple ACCESS 2000-supported commentary code, showing me the necessary symbols and how they work. Or, if ACCESS 2000 does not support such commentary, I'd be grateful to be informed of that.

Thanks.

JerSand
 
I don't think SQL per se supports "comments", as it's a non procedural language. So something like this, which uses the VB(A) comment mark, would probably bomb:
Code:
Select custno     ' customer number
       custname   ' name
       custcity   ' city
....

But if you had the code in a proc someplace, like this, it would probably be ok:

Dim sqlString as string
Code:
sqlString =  _
 "Select Custno" &   ' customer number 
", custname " & _    ' customer name
", custcity from Customers order by custid";

??












78.5% of all statistics are made up on the spot.
Another free Access forum:
More Access stuff at
 
Thank you, WildHare, for confirming my experience with an explanation. It will save me from further futile efforts. I'm grateful.

JerSand
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top