Member Avatar for dmmckelv

Can anyone help? I have been fumbling around with a SQL statement for days trying to make this work. I am looking for a Statement that will output a table based on an incremented number.

Example Table1:
Value1.......Value2.......Incremented Number
14...............null.............1
12..............15...............2
12...............98..............3
15...............14..............4
17...............15..............5
1.................14..............6
5.................98..............7
Example Table2:
Value1.........Value2
X030............1
X842............5
M123............7

Example Output (For all Incremented Number values between Table2.Value2=1 and Table2Value2=5 add X030, etc.):

Value1.......Value2.......Incremented Number
14...............null.............1.....................X030
12..............15...............2......................X030
12...............98..............3......................X030
15...............14..............4......................X030
17...............15..............5......................X842
1.................14..............6......................X842
5..................98..............7.....................M123
etc. etc.

I have tried a bunch of different SELECT Statements using the max function in conjunction with a less than WHERE statement but, am completely missing the mark.

Is there a way to do this in Access using VB code? Actually any help/examples of reading and updating tables using VB would be extremely helpful!

Thanks for your help!
Mark

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.