Alias problem

  • Thread starter Thread starter Shawn
  • Start date Start date
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
 
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.
 
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.
 
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
 
Back
Top