Hello and thank you in advance!
I apologize in advance for my lack of experience in how to create properly aligned examples below.
I have a month's worth of shipment data in a table. The first field in this table is "refnum" which is the unique identifier of this shipment. "refnum" is duplicated since the shipment is reporting vertically, not horizontally.
For instance...
refnum lane stop sequence Lane ID
12345 Saint Louis 1
12345 Chicago 2
12345 Memphis 3
98765 Reno 1
98765 Chino 2
So while the "refnum" is in there 3 times, it is only one shipment.
What I'd like Access to do is create a "Lane ID" that returns the same number by "refnum". So, in Excel, I would write a formula in cell D2 that states =IF(A1="refnum",1,IF(A2=A1,D1,D1+1)).
This formula would produce the below:
refnum lane stop sequence Lane ID
12345 Saint Louis 1 1
12345 Chicago 2 1
12345 Memphis 3 1
98765 Reno 1 2
98765 Chino 2 2
I'm familiar with IIF statements, I'm just not sure how to reference the actual table field.
I apologize in advance for my lack of experience in how to create properly aligned examples below.
I have a month's worth of shipment data in a table. The first field in this table is "refnum" which is the unique identifier of this shipment. "refnum" is duplicated since the shipment is reporting vertically, not horizontally.
For instance...
refnum lane stop sequence Lane ID
12345 Saint Louis 1
12345 Chicago 2
12345 Memphis 3
98765 Reno 1
98765 Chino 2
So while the "refnum" is in there 3 times, it is only one shipment.
What I'd like Access to do is create a "Lane ID" that returns the same number by "refnum". So, in Excel, I would write a formula in cell D2 that states =IF(A1="refnum",1,IF(A2=A1,D1,D1+1)).
This formula would produce the below:
refnum lane stop sequence Lane ID
12345 Saint Louis 1 1
12345 Chicago 2 1
12345 Memphis 3 1
98765 Reno 1 2
98765 Chino 2 2
I'm familiar with IIF statements, I'm just not sure how to reference the actual table field.