Alias problem

S

Shawn

This is the sql I'm trying to run in my access2000 DB:
SELECT Article.aID AS idd
FROM Article
ORDER BY idd;

When I run it Access askes me to enter parameter value for idd. Why? And
what can I do to make it work? I have to be able to order on an alias
name..

Thanks,
Shawn
 
J

John

This is the sql I'm trying to run in my access2000 DB:
SELECT Article.aID AS idd
FROM Article
ORDER BY idd;

When I run it Access askes me to enter parameter value for idd. Why? And
what can I do to make it work? I have to be able to order on an alias
name..

Why do you have to order on the alias name?

"ORDER BY Article.aID" will do the same thing.
 
S

Shawn

Yes, but this was just a simplified sql. When I concatenate 2 fields I have
to use an alias.

SELECT Article.aFirstName + ' ' + Article.aLastName AS aFullName
FROM Article
ORDER BY aFullName

Shawn

This is the sql I'm trying to run in my access2000 DB:
SELECT Article.aID AS idd
FROM Article
ORDER BY idd;

When I run it Access askes me to enter parameter value for idd. Why? And
what can I do to make it work? I have to be able to order on an alias
name..

Why do you have to order on the alias name?

"ORDER BY Article.aID" will do the same thing.
 
J

John

Yes, but this was just a simplified sql. When I concatenate 2 fields I
have
to use an alias.

SELECT Article.aFirstName + ' ' + Article.aLastName AS aFullName
FROM Article
ORDER BY aFullName

If you use the SELECT criteria as the ORDER BY criteria it should work.
This will also sort the last names where there are duplicate first names.

eg

SELECT Article.aFirstName + ' ' + Article.aLastName AS aFullName
FROM Article
ORDER BY Article.aFirstName + ' ' + Article.aLastName ASC

HTH
 

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

Top