Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Quick Queries #93    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Are You Guilty
Richard Rost 
           
4 days ago
Be honest - have you ever spent way too long tracking down a broken Access query, only to realize you forgot to repeat the field name in your WHERE condition? Share your SQL facepalm moments below.
Donald Blackwell  @Reply  
       
4 days ago
Field name in the Where - Yup
Change 1-letter in the source name: i.e. CustomerQ vs CustomerT - Yup
But honestly, the one that gets me the most is if I'm working on multiple DB's at the same time, and especially if  one or more are databases I didn't build originally, trying to use the field name from a table in one DB to represent the same field name in another, i.e. - FirstName vs NameFirst
Richard Rost OP  @Reply  
           
3 days ago
The one that gets me all the time now is that I made a rule for myself to always make my table and query names singular. I started doing this about 10 years ago, like CustomerT instead of CustomersT. I've got some databases that I built before that, including on the website, it's CommentsT. Every time I write SQL, I forget that and it bites me. Of course I'm not going to go through the entire website and change every instance of that. It's not as easy as copy and paste and doing a find and replace in Access.
Alex Lewis  @Reply  
       
23 hours ago
I had a bug in my own database fairly recently.

I recently built a user management system, and I was trying to enforce rules against reusing passwords, and for some reason, my code still allowed me to reuse my previous passwords even though the code I thought would work didn’t work like I expected it to.

I fixed my code by changing the where condition in my SQL statement.

“SELECT * FROM PasswordHistoryT WHERE UserID=“ & TempVars(“UserID”) & “ AND Password=‘“ & Password1 & “ OR Password=‘“ & Password2

In a nutshell, my user management system uses an ADO Recordset from SQL Server to look up previous passwords from the user who logs on. If the password they try to enter into the form exists in my Password History table, it throws up a message box saying “Can’t use a previous password.”
Kevin Robertson  @Reply  
          
22 hours ago
You are missing some quotes.

"SELECT * FROM PasswordHistoryT WHERE UserID=" & TempVars("UserID") & " AND Password='" & Password1 & "' OR Password='" & Password2 & "'"
Alex Lewis  @Reply  
       
22 hours ago
That was my bad, I forgot to include the extra quotes in my post. Thanks Kevin!
Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/25/2026 12:07:45 PM. PLT: 1s