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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy fields from one table to another

SitesMasstec

Programmer
Sep 26, 2010
544
Brasil
Hello colleagues!

I have 2 tables: Table A has 30 fields and Table B has 34 fields.

The 30 first fields in table B are the same (names) in table A. So, Table B has 4 additional fields.

How can I select and copy some filtered records from Table A to Table B, without excluding the last 4 fields in Table B?

I used the command bellow, the records were correctly copied to Table B, but the structure in Table B became with the same structure in table A, that is, the last 4 fields in Table B were lost...

Code:
SELECT * FROM TableA.DBF WHERE LOCALIZA=YLOCALIZA ORDER BY CHAVEPAX INTO TABLE TableB.DBF

Thank you,
 
Criss:

In the Detail1 I have the fields from the table RESERVAS.DBF. There must have just one record (LOCALIZA field, example 5005741)

In the Detail2 I have the fields from the table TEMPPAX.DBF. And all the records in the TEMPPAX.DBF must be printed in the Detail2 of the Report, because all records (maximum 5 records) will have the same data in its LOCALIZA field (in the example, 5005741).

The concept is: the table RESERVAS.DBF is a table which contains data about reservation for one cruise (company, ship, cabin, etc)

The TEMPPAX.DBF has records about passengers of that travel reservation (a cruise cabin can accomodate up to 5 passengers)

These travel passengers are filtered from another table (PASSAGEIROS.DBF), which can contain thousands of passengers. But for this Report, I need the data from RESERVAS.DBF which has the LOCALIZA number 5005741, and all the passengers (maximum possible is 5).
 
Well, you just explained why only 1 record is printed. You only have 1 report driving workarea, even when you add a second detail band.
 

Part and Inventory Search

Sponsor

Back
Top