I'm fairly new to VFP. Currently working with VFP 9. Took over some previous projects. Know really the basics and trying to catch up, so been reading and practicing.
But right now, this problem is beyond my ability and need to find a solution fairly soon. Have to pass the information from 1 table to multiple others, but for now, let's say I have to pass it to a single output table. Been able to do that with 1 record using the INSERT command, but I want to be able to convert a record with 20 fields into another table that has a record for each of the f5-f19 fields (15 fields) of the input table. For the first record in the input table, this would translate into 15 records. Record two from the input table would output 5 records, and so on. Basically I want to create a single record for each of the f5 thru f19 fields, with each record of course, having the information from fields f1-f4.
Been trying but have not been able to make it work.
My Input table (Tab1) has 20 fields
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20
1 CAN A12 15000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 15
2 MEX B12 4320 1000 1000 1000 1000 320 5
3 US C24 6850 1000 1000 1000 1000 1000 1000 850 7
4 US C32 3500 1000 1000 1000 500 4
etc...
My Output table (Tab2) has to be somewhat like this:
f1 f2 f3 f4 f5 f6 f7
1 CAN A12 1000 15 1 15
1 CAN A12 1000 15 2 15
1 CAN A12 1000 15 3 15
1 CAN A12 1000 15 4 15
1 CAN A12 1000 15 5 15
1 CAN A12 1000 15 6 15
1 CAN A12 1000 15 7 15
1 CAN A12 1000 15 8 15
1 CAN A12 1000 15 9 15
1 CAN A12 1000 15 10 15
1 CAN A12 1000 15 11 15
1 CAN A12 1000 15 12 15
1 CAN A12 1000 15 13 15
1 CAN A12 1000 15 14 15
1 CAN A12 1000 15 15 15
2 MEX B12 1000 5 1 5
2 MEX B12 1000 5 2 5
2 MEX B12 1000 5 3 5
2 MEX B12 1000 5 4 5
2 MEX B12 320 5 5 5
3 US C24 1000 7 1 7
3 US C24 1000 7 2 7
3 US C24 1000 7 3 7
3 US C24 1000 7 4 7
3 US C24 1000 7 5 7
3 US C24 1000 7 6 7
3 US C24 850 7 7 7
4 US C32 1000 4 1 4
4 US C32 1000 4 2 4
4 US C32 1000 4 3 4
4 US C32 500 4 4 4
etc...
Last 3 fields are only the number of transactions per account.
Here's an image of my 2 tables showing what I would like to accomplish:
Thanks, I would appreciate any help/guidance.
Gloria
But right now, this problem is beyond my ability and need to find a solution fairly soon. Have to pass the information from 1 table to multiple others, but for now, let's say I have to pass it to a single output table. Been able to do that with 1 record using the INSERT command, but I want to be able to convert a record with 20 fields into another table that has a record for each of the f5-f19 fields (15 fields) of the input table. For the first record in the input table, this would translate into 15 records. Record two from the input table would output 5 records, and so on. Basically I want to create a single record for each of the f5 thru f19 fields, with each record of course, having the information from fields f1-f4.
Been trying but have not been able to make it work.
My Input table (Tab1) has 20 fields
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20
1 CAN A12 15000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 15
2 MEX B12 4320 1000 1000 1000 1000 320 5
3 US C24 6850 1000 1000 1000 1000 1000 1000 850 7
4 US C32 3500 1000 1000 1000 500 4
etc...
My Output table (Tab2) has to be somewhat like this:
f1 f2 f3 f4 f5 f6 f7
1 CAN A12 1000 15 1 15
1 CAN A12 1000 15 2 15
1 CAN A12 1000 15 3 15
1 CAN A12 1000 15 4 15
1 CAN A12 1000 15 5 15
1 CAN A12 1000 15 6 15
1 CAN A12 1000 15 7 15
1 CAN A12 1000 15 8 15
1 CAN A12 1000 15 9 15
1 CAN A12 1000 15 10 15
1 CAN A12 1000 15 11 15
1 CAN A12 1000 15 12 15
1 CAN A12 1000 15 13 15
1 CAN A12 1000 15 14 15
1 CAN A12 1000 15 15 15
2 MEX B12 1000 5 1 5
2 MEX B12 1000 5 2 5
2 MEX B12 1000 5 3 5
2 MEX B12 1000 5 4 5
2 MEX B12 320 5 5 5
3 US C24 1000 7 1 7
3 US C24 1000 7 2 7
3 US C24 1000 7 3 7
3 US C24 1000 7 4 7
3 US C24 1000 7 5 7
3 US C24 1000 7 6 7
3 US C24 850 7 7 7
4 US C32 1000 4 1 4
4 US C32 1000 4 2 4
4 US C32 1000 4 3 4
4 US C32 500 4 4 4
etc...
Last 3 fields are only the number of transactions per account.
Here's an image of my 2 tables showing what I would like to accomplish:
Thanks, I would appreciate any help/guidance.
Gloria