select (distinct fieldname) in access ?

P

Paulo Nunes

Hi all

Is it possible to do this in MS Access?

select (distinct fieldname)
from ...

If not, is there an alternative?

Thanks in advance
Paulo
 
T

Tom Ellison

Dear Paulo:

I'm not trying to be funny, but have you tried:

SELECT DISTINCT fieldname
FROM . . .

As long as there's only one column in your query that would give what
you seem to want. Or is it more complex than that?

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
P

Paulo Nunes

Sorry, I haven't explained myself properly.

What I want is really something like SELECT SUM(DISTINCT fieldname) ,
fieldname2.

I've read that this is not possible in MS Access, just in MS SQL Server.

Is there a way to work around this?

Thanks for help
Paulo
 
V

Van T. Dinh

Try something like:

SELECT Sum([FieldName])
FROM
(SELECT DISTINCT [FieldName] FROM [YourTable])

HTH
Van T. Dinh
MVP (Access)
 
Top