Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-13-2015, 11:17 PM   #1
strategy
Newly Registered User
 
Join Date: Jan 2015
Posts: 1
Thanks: 2
Thanked 0 Times in 0 Posts
strategy is on a distinguished road
Question supplier with more than one category

Hello
I've got a table called invoice with a field supplier and another one invoice_category among others.
How can I retrieve all the suppliers that have more than two categories in the invoice table.

I tried
Code:
select count(*) from (select distinct invoice_category from invoice)
but it didn't work.

Any ideas?

strategy is offline   Reply With Quote
Old 01-14-2015, 05:15 PM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,343
Thanks: 40
Thanked 3,670 Times in 3,538 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: supplier with more than one category

suggest you use the query wizard for find duplicates on the following query

Code:
 
 select distinct supplier, invoice_category from invoice
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
strategy (01-15-2015)
Old 01-14-2015, 10:40 PM   #3
smig
Newly Registered User
 
Join Date: Nov 2009
Location: Israel
Posts: 2,043
Thanks: 82
Thanked 134 Times in 125 Posts
smig is on a distinguished road
Re: supplier with more than one category

I normally use the query builder for this.

Code:
SELECT [supplier]
FROM [invoice]
GROUP BY [supplier]
HAVING Count([invoice_category]) > 2;

smig is offline   Reply With Quote
The Following User Says Thank You to smig For This Useful Post:
strategy (01-15-2015)
Reply

Tags
count , query

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
e-mail report based on supplier steve111 Reports 1 04-28-2014 05:57 AM
New Parts and Supplier Database hullstorage Tables 9 02-18-2012 11:44 AM
Customer & Supplier - what if they are both? Mark-BES General 12 10-05-2006 11:39 AM
When a supplier is also a customer..... getssmart Theory and practice of database design 5 10-05-2006 06:03 AM
Show Contact Name Unique to Supplier scouser Forms 7 01-27-2005 05:33 AM




All times are GMT -8. The time now is 03:39 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World