S
SLW612
Hi,
I am new to Access and could use some help with a "count-if" type query. I
have 3 tables - t_Comm, t_Ven, and t_Details.
The t_Comm table has three columns: Comm_ID (Primary key), CommName,
CommAbrev.
t_Ven has two columns: Ven_ID (primary key), VenName. These tables are used
as lists only, for lookup purposes.
t_Details has columns: D_ID (primary key), Ven (values from t_Ven), Comm
(values from t_Comm), Int_ID. Here is a brief example of the t_Details
table:
ID Ven Comm Int_ID
1 Ven_A Com_1
2 Ven_B Com_1
3 Ven_A Com_1
4 Ven_A Com_2
5 Ven_A Com_1
What I want to do is keep track of the number of times the Ven-Comm
combination appears and count up from there, keeping track of this number in
field Int_ID, and combine it with the CommAbrev. So eventually, the table
would look like this:
ID Ven Comm Int_ID
1 Ven_1 Com_A C1-1
2 Ven_2 Com_A C1-1
3 Ven_1 Com_A C1-2
4 Ven_1 Com_B C2-1
5 Ven_1 Com_A C1-3
And so on. Now, I'm thinking a query is how I would go about this but I
have no idea how to write one - I am much more versed with Excel VBA but
haven't spent much time with Access. Hopefully this makes enough sense to
work with!
Thanks in advance!
I am new to Access and could use some help with a "count-if" type query. I
have 3 tables - t_Comm, t_Ven, and t_Details.
The t_Comm table has three columns: Comm_ID (Primary key), CommName,
CommAbrev.
t_Ven has two columns: Ven_ID (primary key), VenName. These tables are used
as lists only, for lookup purposes.
t_Details has columns: D_ID (primary key), Ven (values from t_Ven), Comm
(values from t_Comm), Int_ID. Here is a brief example of the t_Details
table:
ID Ven Comm Int_ID
1 Ven_A Com_1
2 Ven_B Com_1
3 Ven_A Com_1
4 Ven_A Com_2
5 Ven_A Com_1
What I want to do is keep track of the number of times the Ven-Comm
combination appears and count up from there, keeping track of this number in
field Int_ID, and combine it with the CommAbrev. So eventually, the table
would look like this:
ID Ven Comm Int_ID
1 Ven_1 Com_A C1-1
2 Ven_2 Com_A C1-1
3 Ven_1 Com_A C1-2
4 Ven_1 Com_B C2-1
5 Ven_1 Com_A C1-3
And so on. Now, I'm thinking a query is how I would go about this but I
have no idea how to write one - I am much more versed with Excel VBA but
haven't spent much time with Access. Hopefully this makes enough sense to
work with!
Thanks in advance!