Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FIELD help

Status
Not open for further replies.

starskyuk

Programmer
Jun 6, 2001
2
US
Hi

I am trying to merge a database of single field records to create record of 30 fields. i.e. records 1,2,3...30 to become one record containig the data from those records ie rec1 = field1..field30, rec 2 field31..field60 etc
I have tried using the FIELD() command to increment the field number when relacing data.

Any ideas? Please use Leymans terms as i am new !
Many Thanks
 
Try this:
For x = 1 to 30
y = ltrim(str(x))
xRec1 = Field&y +" "&& assuming the name of the field
is field1, field2, field3 etc..
next x

Select YourSecondTable
Append blank && add new record
replace YourFieldName with xRec1

and so on... Please let me know if this helped you :)

Tekno
Wireless Toyz
Ypsilanti, Michigan
 
or if the name of the field is not field1,2,3,etc..

Local x,cFieldName,cFieldValue
for x = 1 to 30
cFieldName = field(x) && get field Name
cFieldValue = cFieldValue + &cFieldName && get the data
next x

now cFieldValue will contain the values of the first 30 fields!!! Please let me know if this helped you :)

Tekno
Wireless Toyz
Ypsilanti, Michigan
 
Oppps for the 1st post

xRec1 = xRec1 + Field&y + ' '

otherwise, xRec1 will not be adding all the field values!! Please let me know if this helped you :)

Tekno
Wireless Toyz
Ypsilanti, Michigan
 
As Teknos solution connect 30 records to one fields one record,
if you want to one records 30 fields,
try
sele single
scan
sele thirty
appe blank
sele single
for ii = 1 to 30
fp = ltrim(str(ii,0))
sele thirty
repl field&fp with single.field
sele single
skip
if eof()
exit
endif
endfor
endscan
*(not tested)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top