Showing only one of dublicate entries

  • Thread starter Thread starter Robert Raley
  • Start date Start date
R

Robert Raley

I have a UNION query that returns some duplicates values.

What I would like to have is a list of the [stage_name] where the name is
only shown one time.

This is my query

SELECT stage_name, Name FROM qry_mod_trans_min;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_det;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_man;

How do I do show all names but with out dublicates. It is really affecting
my reports because the subreports that are linked by [stage_name] are
showing 2 times.
Thanks for your help.

Bob
 
Robert said:
I have a UNION query that returns some duplicates values.

What I would like to have is a list of the [stage_name] where the name is
only shown one time.

This is my query

SELECT stage_name, Name FROM qry_mod_trans_min;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_det;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_man;

How do I do show all names but with out dublicates. It is really affecting
my reports because the subreports that are linked by [stage_name] are
showing 2 times.
Thanks for your help.


You could try using UNION instead of UNION ALL.
 
Thanks Andrea. It had no effect at all.

I do appreciate the attempt though

Bob

Andrea Jones said:
Start your SQL with the words SELECT DISTINCT to only show one instance of
each stage_name.

Andrea Jones
www.allaboutoffice.co.uk

Robert Raley said:
I have a UNION query that returns some duplicates values.

What I would like to have is a list of the [stage_name] where the name is
only shown one time.

This is my query

SELECT stage_name, Name FROM qry_mod_trans_min;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_det;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_man;

How do I do show all names but with out dublicates. It is really affecting
my reports because the subreports that are linked by [stage_name] are
showing 2 times.
Thanks for your help.

Bob
 
ThanksMarshall. Worked like a charm.

I should have caught that. Getting slow in my old age.

Bob


Marshall Barton said:
Robert said:
I have a UNION query that returns some duplicates values.

What I would like to have is a list of the [stage_name] where the name is
only shown one time.

This is my query

SELECT stage_name, Name FROM qry_mod_trans_min;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_det;
UNION ALL SELECT stage_name, Name FROM qry_mod_trans_man;

How do I do show all names but with out dublicates. It is really affecting
my reports because the subreports that are linked by [stage_name] are
showing 2 times.
Thanks for your help.


You could try using UNION instead of UNION ALL.
 
Back
Top