Re: Where clause is not working
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Sun, 1 Nov 2009 20:09:35 +0800
Suggestions:
a) Add a square bracket around any names that start with a digit e.g.
[2A]
That's the reason for the syntax error.
b) Your 2nd example has the quote mark in the wrong place. Everything inside quotes resolves to a non-zero value, which is treated as True. Since the WHERE clause evaluates to True (regardless of the record), all records are returned.
c) Avoid using Name as a field name in Access. Most objects (forms, reports, ....) have a Name property, and Access gets confused about what you mean. Consider renaming the field to something else and see if it works. Here's a list of the words to avoid:
http://allenbrowne.com/AppIssueBadWord.html#N
d) Before renaming the field, ensure that Name AutoCorrect is off.
http://allenbrowne.com/bug-03.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"jatin chaturvedi" wrote in message news:20091113324jchaturv@xxxxxxxxxxxx
I am using MS Access 2007. I am getting syntax error when I run this query
Select 2A.* from 2A where 2A.[Name]= 'Jatin';
when I run query below, It gives all the result i.e. where clause is not working.
Select 2A.* from 2A where '2A.[Name]= Jatin';
Please help
EggHeadCafe - Software Developer Portal of Choice
Build a C# NotifyIcon BalloonTip Scheduled Outlook Mail Checker
http://www.eggheadcafe.com/tutorials/aspnet/0235490b-a901-42b4-9eef-7dd29b6ae909/build-a-c-notifyicon-bal.aspx
.
- References:
- Where clause is not working
- From: jatin chaturvedi
- Where clause is not working
- Prev by Date: Where clause is not working
- Next by Date: Filtering records for 2 types of dates
- Previous by thread: Where clause is not working
- Next by thread: Filtering records for 2 types of dates
- Index(es):
Relevant Pages
|