I have some very difficult task to accomplish using ADODB, or DAO in visual basic 6 whichever. This is my masters project and I am stuck!! Say I have a recordset with 4 customers such as:
Expand|Select|Wrap|Line Numbers
- Field1 Field2 Field3 Field4 Field5 Field6 Field7
- E N E E N E N
- E E E N E E N
- E N E E E N N
- N N E N N N N
Expand|Select|Wrap|Line Numbers
- E=estimated value
- N=normal value
Expand|Select|Wrap|Line Numbers
- Field1 Field2 Field3 Field4 Field5 Field6 Field7
- E1 N2 E3 E4 N5 E6 N7
Field 1: Converting field1 to normal value, we have to see the number of estimates before field2, since there is only one, so I need to update in such a way:
Expand|Select|Wrap|Line Numbers
- Field1 Field2 Field3 Field4 Field5 Field6 Field7
- N2/2 N2/2 E E N E N
Field 5: Converting field3, field4 to normal value, we have to see the number of estimates after the last normal value I.e. field2 until field 5, since there are 3, so I need to update in such a way:
Expand|Select|Wrap|Line Numbers
- Field1 Field2 Field3 Field4 Field5 Field6 Field7
- N2/2 N2/2 N5/3 N5/3 N5/3 E N
Field 7: Converting field6 to normal value, we have to see the number of estimates after the last normal value I.e. field5 until field 7, since there is only 1, so I need to update in such a way:
Expand|Select|Wrap|Line Numbers
- Field1 Field2 Field3 Field4 Field5 Field6 Field7
- N2/2 N2/2 N5/3 N5/3 N5/3 N7/2 N7/2
Provided there is one constraint, if the last value i.e. Field7 is “E” then obviously we cannot normalize the value and update, since there is no “N” value next, so I can use sql to filter those records in that case (which is very frequent).
Basically, my values for E and N in the recodset are such that, I make it a bit easy:
Expand|Select|Wrap|Line Numbers
- E= “E:<value here>”
- N= “N:<value here>”
Note the problem is the gaps between "N" and "E" are never fixed always changing, this is causing the main problem. Anyway to tackle this?? Any psuedocode or logic??
Any help regarding this type of problem. I know this is difficult. All help is appreciated.