Solved Show Records if More than 1 (1 Viewer)

Number11

Member
Local time
Today, 20:32
Joined
Jan 29, 2020
Messages
607
So i can get this to work I need the query to show me records if more than i record shows for customer [account Number]

count >1
did work
 

cheekybuddha

AWF VIP
Local time
Today, 20:32
Joined
Jul 21, 2014
Messages
2,267
Hi,

More info please! Remember, we can't see your computer screen and have no idea about your database!

What is the table name?
What are the field names?
Which field is the Primary Key?

What is the SQL of your query that doesn't work as you want it to?

You say Count > 1 works, so what else do you need?
 

Number11

Member
Local time
Today, 20:32
Joined
Jan 29, 2020
Messages
607
Hi,

More info please! Remember, we can't see your computer screen and have no idea about your database!

What is the table name?
What are the field names?
Which field is the Primary Key?

What is the SQL of your query that doesn't work as you want it to?

You say Count > 1 works, so what else do you need?

sorry not count >1 brings back all customers

So i have a table that the customer gets added to in an order is outstanding each week, so the 1st time they are added i dont want to include them in my report, but if they are added on the 2nd week then i wish to have these included. I have a field with date/time stamp that they were added along with customer account number and order number. so looking to include the customer ion my report only if in table more than once?
 

cheekybuddha

AWF VIP
Local time
Today, 20:32
Joined
Jul 21, 2014
Messages
2,267
What is the table name?
What are the field names?
Which field is the Primary Key?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:32
Joined
May 7, 2009
Messages
19,227
and a Condition to your Query:

select * from yourTable Where (Select Count("1") from From yourTable As T where T.[customer account number] = yourTable.[customer account number] and T.[order number]=yourTable.[order number]) > 1
 

cheekybuddha

AWF VIP
Local time
Today, 20:32
Joined
Jul 21, 2014
Messages
2,267
Using the table/field names from your other thread, your query might look like:
SQL:
SELECT
  [Account No]
FROM Master
GROUP BY 
  [Account No]
HAVING COUNT(*) > 1
;

hth,

d
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:32
Joined
May 7, 2009
Messages
19,227
on other thought:
Code:
select * from [orderTable]
Where (select Count("1") from [theTableWhereYouSavedEveryWeek] As T
Where T.[customer]=[orderTable].[customer] and
T.[account no]=[orderTable].[account no]) > 1
 

Number11

Member
Local time
Today, 20:32
Joined
Jan 29, 2020
Messages
607
on other thought:
Code:
select * from [orderTable]
Where (select Count("1") from [theTableWhereYouSavedEveryWeek] As T
Where T.[customer]=[orderTable].[customer] and
T.[account no]=[orderTable].[account no]) > 1

was going to run this from a query so can i just apply the criteria
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 20:32
Joined
Jan 14, 2017
Messages
18,209
Have you tried the built-in duplicates query wizard?
 

Users who are viewing this thread

Top Bottom