Sabtu, 14 Januari 2023

Re: [MSAccessProfessionals] Identify non-unique fields in a column

Thanks Paul. Since this is a large dataset I think I will just bite the bullet and use the joined two query method.


On Friday, January 13, 2023 at 12:35:32 PM CST, Paul Baldy <pbaldy@gmail.com> wrote:


You could use a DCount() or subquery in the MultipleOrder field, but on larger datasets the two-query method would likely be much more efficient.  That assumes you were going to use a join on the queries.

Paul


------ Original Message ------
From "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Date 1/13/2023 10:29:56 AM
Subject [MSAccessProfessionals] Identify non-unique fields in a column

Greetings All.

I know that you can easily use Access to identify "Unique Records" but this is slightly different.

Imagine I have a simple table with CustomerID, ProductID & InvoiceNum but I want create a query with an additional column "MultipleOrder" which identifies if an Invoice has more than one product on it. ie if the InvoiceNum is not unique then it is a multiple order.

Hence the resulting query would like this

Inline image">

Obviously I can do this by creating two queries, the first to count how many records there are for each InvoiceNum and then a second query referencing both the table and the query to identify InvoiceNum with a count greater than one.

Is there a way to do this all in one query though?

Thanks, Sean



Tidak ada komentar:

Posting Komentar