Help with Multi-table query: Which "Producer Code" has been in a transaction the most? (1 Viewer)

emus

New member
Local time
Today, 12:44
Joined
Nov 17, 2021
Messages
8
Hi, before I get into it, I will translate some field names for you. (Üretici Kodu: Producer Code, Stok Adı: Stock Name)
I am trying to do a query to display which "Producer Code" has been used the most in the transactions. But the "Producer Codes" aren't in a combo box format because I imported them from an excel where the "Producer Codes" were written manually. Because there are over 6000 products and indefinite amount of "Producer Codes" (I haven't gone through all of them to see how many but there is a reasonable amount.). I want to do a query to see how many times a "Producer Code" has been used in a transaction.
For example: if there are 3 transactions with ProductID:1, ProductID:4 and ProductID:5 I want to see Producer Code ALMAN:1 and ORJ:2. Or something to the same effect in datasheet form.
I am very new to access and don't have any education about coding or database design. I am only doing this for a highschool project so I would appreciate it if you could explain it simply. I hope the attachments will be of any help. Thanks for your help.
 

Attachments

  • transactions.PNG
    transactions.PNG
    28.6 KB · Views: 290
  • producercode.PNG
    producercode.PNG
    90.9 KB · Views: 289
  • relationship.PNG
    relationship.PNG
    7.9 KB · Views: 293
  • query.PNG
    query.PNG
    19.9 KB · Views: 295

theDBguy

I’m here to help
Staff member
Local time
Today, 02:44
Joined
Oct 29, 2018
Messages
21,467
Hi. Welcome to AWF!

You could try using a Totals query.

Sent from phone...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:44
Joined
Feb 19, 2002
Messages
43,263
Select ProducerCode, Count(*) As UsedCount
From tblTransactions
Group By ProducerCode;
 

Users who are viewing this thread

Top Bottom