Ranking in Querry

G

Guest

I want to rank records in query,found on microsoft support center and used it
like this:
Seniority: (Select Count(*) from Registery Where _ [score1] <
[Emp1].[score1]+1;)
but it didn`t work in access 2003, becouse of "Syntax Error" for "_" after
where,
i changed it to "-", but it didn`t work again, what should i do?
 
A

Allen Browne

Omit the underscore.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
D

David Cox

... Where _ [score1] < [Emp1].[score1]+1;)

I cannot speak for Access but I do not understand what you are trying to do.

if there is more than one field called score1 which one is is wanted in the
first reference?

What is _ meant to indicate?
 
M

Marshall Barton

Ehsan Toofaninejad <Ehsan
I want to rank records in query,found on microsoft support center and used it
like this:
Seniority: (Select Count(*) from Registery Where _ [score1] <
[Emp1].[score1]+1;)
but it didn`t work in access 2003, becouse of "Syntax Error" for "_" after
where,
i changed it to "-", but it didn`t work again, what should i do?


What do you think the _ is supposed to do?

Generally, you need to alias the subquery's table name so
you can disambiguate the field name:

Seniority: (Select Count(*) From Registery As X Where
X.[score1] < [Emp1].[score1]+1)

but I have no idea what Emp1 is supposed to be, nor why it
should not be Registery (is that misspelling intentional?).
OTOH, maybe Registry should be Emp1??
 
G

Guest

thanks i did it and work

Allen Browne said:
Omit the underscore.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
I want to rank records in query,found on microsoft support center and used
it
like this:
Seniority: (Select Count(*) from Registery Where _ [score1] <
[Emp1].[score1]+1;)
but it didn`t work in access 2003, becouse of "Syntax Error" for "_" after
where,
i changed it to "-", but it didn`t work again, what should i do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top