Re: Access Query
- From: "Bob Barrows" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 24 Aug 2009 15:26:00 -0400
"Group" is a reserved keyword and should be avoided when naming your
table. If it's not too late, you should rename that table. If it is too
late or too much trouble, then you need to either bracket [] every
occurence of the word "Group" in your query,
SELECT [Group].UserName, [Group].DirectoryName
FROM [Group]
WHERE ((([Group].UserName)=[Enter Name]));
or better yet, use an alias:
SELECT g.UserName, g.DirectoryName
FROM [Group] As g
WHERE (((g.UserName)=[Enter Name]));
You can make this change directly in the SQL View, or you can do it in
Design View using the Properties window for the table "object" in the
Tables area.
"UserName" also looks suspect, but according to
http://www.aspfaq.com/show.asp?id=2080, it is not reserved.
Chris wrote:
SELECT Group.UserName, Group.DirectoryName
FROM [Group]
WHERE (((Group.UserName)=[Enter Name]));
"KARL DEWEY" wrote:
Open the query in design view, click on VIEW - SQL View, highlight
all, copy, and paste in a post.
--
Build a little, test a little.
"Chris" wrote:
sorry but without sounding too new to the program how do I post my
SQL of the query?
"KARL DEWEY" wrote:
I expect that you are storing a number instead of a name.
Post your query SQL as Klatuu suggested.
--
Build a little, test a little.
"Chris" wrote:
yea I have other tables that are storing other information and
then I am bringing them all together with this table. So I have
one table with everyones name in it once and then my main table
has the name multiple times so that I can show what different
folders they are allowed to view. The same applies to the other
columns that are in the main table. The information all come
from other tables. They are all lookup fields. I hope that you
understand. It may be that I don't even have the database set up
right. It has been a long time since I have used access.
"KARL DEWEY" wrote:
Are you using a lookup field in the table for name?
Are you storing a name or number?
--
Build a little, test a little.
"Chris" wrote:
When i did that I was propted with this "This expression os
typed incorrectly, or is too complex to be evaluated. For
example, a numeric expression may contain too many complicated
elements. Try simplifying the expression by assigning parts of
the expression to valiables." Maybe I should have also
mentioned that I am trying to run this one query based off of
one table. I don't know if that changes anything or not
though.
"KARL DEWEY" wrote:
Open in the design view and enter this as the criteria --
[Enter name]
--
Build a little, test a little.
"Chris" wrote:
I have a database where I have people listed with two other
columns of data that goes with the name. The names are
listed multiple times. I was wondering if anyone could tell
me how to run a query where I pull just one specific person
where I can look at just their information that relates to
them. I know how to make it ask for the name but I am having
problems with the syntax for the criteria that I need to
write to make it give me just the one name.
--
HTH,
Bob Barrows
.
- Follow-Ups:
- Re: Access Query
- From: Chris
- Re: Access Query
- References:
- Access Query
- From: Chris
- RE: Access Query
- From: KARL DEWEY
- RE: Access Query
- From: Chris
- RE: Access Query
- From: KARL DEWEY
- RE: Access Query
- From: Chris
- RE: Access Query
- From: KARL DEWEY
- RE: Access Query
- From: Chris
- RE: Access Query
- From: KARL DEWEY
- RE: Access Query
- From: Chris
- Access Query
- Prev by Date: Re: I need help writing a query
- Next by Date: Group by and count queries
- Previous by thread: RE: Access Query
- Next by thread: Re: Access Query
- Index(es):
Relevant Pages
|