I have the following table (Table1) in an Access 2003 database:
PART# WHLOC #LOCS
PART1 R1SH2
PART2 R3SH1
PART2 R1SH4
PART3 R4SH3
I need to run a query to populate the '#LOCS' field for each record with a number that indicates how many locations each part resides in and append it to 'Table2'. Like this:
PART# WHLOC #LOCS
PART1 R1SH2 1
PART2 R3SH1 1
PART2 R1SH4 2
PART3 R4SH3 1
In Excel, I would populate the #LOCS column using this formula:
=IF(A2<>A1,1,IF(A2=A1,D1+1,""))
I could export Table1, run the above formula and then import the spreadsheet in Access once again as Table2, but I'd like to accomplish this completely in Access is possible.
Can someone help me figure out how to do this?
Each part can ONLY reside in 7 locations, if it matters.
Thanks in advance!
- Turb
PART# WHLOC #LOCS
PART1 R1SH2
PART2 R3SH1
PART2 R1SH4
PART3 R4SH3
I need to run a query to populate the '#LOCS' field for each record with a number that indicates how many locations each part resides in and append it to 'Table2'. Like this:
PART# WHLOC #LOCS
PART1 R1SH2 1
PART2 R3SH1 1
PART2 R1SH4 2
PART3 R4SH3 1
In Excel, I would populate the #LOCS column using this formula:
=IF(A2<>A1,1,IF(A2=A1,D1+1,""))
I could export Table1, run the above formula and then import the spreadsheet in Access once again as Table2, but I'd like to accomplish this completely in Access is possible.
Can someone help me figure out how to do this?
Each part can ONLY reside in 7 locations, if it matters.
Thanks in advance!
- Turb