DISTINCTROW doesn't yield off unique rows in one of my columns

G

Guest

Hi, I need a Filter1 column that gives out unique sets of characters but the
DISTINCTROW command can't seem to be able to filter it fine, I'm still seeing
multiple rows in Filter1 column having exactly the same set of characters. Is
DISTINCTROW supposed to work?

SELECT DISTINCTROW VOYAGER_F_PRODUCT.FACILITY, VOYAGER_F_PRODUCT.PRODUCT,
VOYAGER_F_OPERATION.OPERATION, VOYAGER_F_PRODUCT.PRODUCT_DESCRIPTION,
Left([VOYAGER_F_PRODUCT].[PRODUCT],15) AS Filter1
FROM VOYAGER_F_PRODUCT INNER JOIN VOYAGER_F_OPERATION ON
VOYAGER_F_PRODUCT.FACILITY = VOYAGER_F_OPERATION.FACILITY
GROUP BY VOYAGER_F_PRODUCT.FACILITY, VOYAGER_F_PRODUCT.PRODUCT,
VOYAGER_F_OPERATION.OPERATION, VOYAGER_F_PRODUCT.PRODUCT_DESCRIPTION,
Left([VOYAGER_F_PRODUCT].[PRODUCT],15)

Is it possible to use DISTINCT on one colum say
SELECT VOYAGER_F_PRODUCT.FACILITY, VOYAGER_F_PRODUCT.PRODUCT,
VOYAGER_F_OPERATION.OPERATION, VOYAGER_F_PRODUCT.PRODUCT_DESCRIPTION,
DISTINCT Left([VOYAGER_F_PRODUCT].[PRODUCT],15) AS Filter1

but my problem here is that I have a syntax error (missing operator) and i
can't seem to fix the syntax
 
J

John Vinson

Hi, I need a Filter1 column that gives out unique sets of characters but the
DISTINCTROW command can't seem to be able to filter it fine, I'm still seeing
multiple rows in Filter1 column having exactly the same set of characters.

Use DISTINCT instead of DISTINCTROW. DISTINCT looks only at the fields
in the SELECT clause; DISTINCTROW looks at all fields, selected or
not.

John W. Vinson[MVP]
 

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