Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Merging multiple records into one
Message
 
 
To
13/07/2006 10:30:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01136022
Message ID:
01136030
Views:
11
Frank,

Why can't the code that does the second batch of inserts first check to see if the Field1 row already exists and simply update the Field4 and Field5 columns?

>I have a system where a user can enter different batches of data at different times. I then need to merge the different batches together into one record based on an identifying field value.
>
>For example, I have a table with these fields:
>
>Field1, Field2, Field3, Field4 and Field5 (not their real names just used for the example).
>
>Field1 is the field that identifies a particular record.
>
>User 1 enters data in Field1, Field2 and Field3. This gets stored in one record. User 2 then enters Field1, Field4 and Field5, which gets appended to the same table as User 1's record.
>
>I then need to go through this table and pull out all the records that have the same value in Field1 and merge them into one record. I won't know which fields have values in for each record.
>
>Has anybody done anything similar and have any suggestions as to the best and most generic way to approach this? The part that I am seeing as being tricky is ensuring that I don't overwrite a field with an empty value.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform