Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Updating normal and estimated values in recordset



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Visual Basic Forum
View previous topic :: View next topic  
Author Message
awyeah



Joined: 02 Jul 2008
Posts: 1

PostPosted: Wed Jul 02, 2008 2:00 pm    Post subject: Updating normal and estimated values in recordset Reply with quote

Hello everyone,

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:

Code:

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


Code:

E=estimated value
N=normal value


The number of records are 180,000k (rows), so this cannot be done manually. Basically for rows I wish to convert estimated values into normal values. So row1 is:

Code:

Field1      Field2      Field3      Field4      Field5      Field6      Field7
E1      N2      E3      E4      N5      E6      N7


CONVERSION
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:

Code:

Field1      Field2      Field3      Field4      Field5      Field6      Field7
N2/2      N2/2      E      E      N      E      N


Then continue to the next estimated element if there is any in that row.
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:

Code:

Field1      Field2      Field3      Field4      Field5      Field6      Field7
N2/2      N2/2      N5/3      N5/3      N5/3      E      N


Then continue to the next estimated element if there is any in that row.
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:

Code:

Field1      Field2      Field3      Field4      Field5      Field6      Field7
N2/2      N2/2      N5/3      N5/3      N5/3      N7/2      N7/2


And then continue to the next row, since there is no "E" element and/or the last field of the row was achieved. Then repeat this for all the rows in the recordset.
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:

Code:

E= “E:<value here>”
N= “N:<value here>”


So after I check whether it is “N” or “E” I can split the string with respect to “:” and using the first index, i.e. index=1 to retrieve the value from the string, and can then update it to which ever format I like.

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Visual Basic Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap