Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Expert > X03 > < X02 | X04 >
Back to Access Expert 3    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Cleaning up SQL Statement
Benjamin Heacox 
    
2 years ago
@ 5:05 Could you help me understand why the "CustomerComboQ" designation of each of the fields is in brackets, but the CustomerComboQ that is the criteria to pick from (..FROM CustomerComboQ ORDER BY..) is not in brackets / does not need to be in brackets?
Scott Axton  @Reply  
          
2 years ago
Back up to about 4:00  min and listen again.  Richard explains it pretty plainly.

1. If you are only working with one table or query, you don't need the TableName  - [TableName].[FieldName]
2. If you make your names as Richard teaches, no spaces, you don't have to put the brackets around the field name.

So say your field name (with a space) is:   Customer Name  
You would have to enclose that with the brackets like:  [Customer Name]
If you name it properly, without a space:  CustomerName  That is all you need because Access recognizes that as a valid field.

The same applies with naming your tables.  If you have a space Customer Combo Q  brackets are required.
[Customer Combo Q]
No space: CustomerComboQ is all that is needed.

In a nutshell the [ and the ] tells where the field name starts and stops so that Access understands.

Hope that helps.
Benjamin Heacox OP  @Reply  
    
2 years ago
Scott, thank you for your swift response. I understood that when a field or property has a spacebar in it, it needs brackets, but none of the fields or tables in this SQL command had spaces. My question then becomes why would Access put the brackets on some fields and not others?

Sometimes I get in my head and end up asking questions that I later realize are essentially irrelevant because I think I may need to know the answer someday, or that if I had known earlier I might avoid confusion. If I am off in the weeds over this question and it won't really matter, please let me know. I am just fearful that because I am completely new to this I will end up writing SQL that access doesn't recognize because I haven't formatted it correctly - with or without needed brackets.

Thank you for your time.
Scott Axton  @Reply  
          
2 years ago
I really can't answer your question as to why Access does what it does.  I've just learned to deal with it.
In the query designer especially you have to explicitly enter the brackets - otherwise Access will put your field name in quotes, even when you don't have a space in the field name.

It really is one of those things you just learn to work with over time.  I don't even know of a "list of quirks" to tell you when to or what to watch out for.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Expert 3.
 

Next Unseen

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/13/2025 5:17:45 PM. PLT: 1s