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

Query by Example to insert table with +

Status
Not open for further replies.

jlockley

Technical User
Nov 28, 2001
1,522
US
I am trying to use an Insert query to add the fields from table A to existing table B. Table A was imported from Cardscan, which for no sensible reason places phone numbers in any of about twelve fields.

Rather than practice more on the "changeto" method (using that to adjust the source table to one field for each destination field) I thought I would follow instructions in a QUE quide which read:

"Use example elements to connect each field in the source table to the destination table. To change the example element, click the Join Tables button on the SpeedBar (I am working on that..may be my problem.) *If you want to combine two fields from the source table (Cardscan) in to one field in the destination table (Roladex), (I do) use + to connect the examle elements in the destination field."

WHERE!!!????? Where does the benighted + belong???? before? after? with a space? a coma? somewhere entirely different? WHERE for the love of Mike are you supposed to put the thing?

OK, rant over. specifics: Nothing works.

If I just put example elements in any two fields I get an empty Insert table.

I have one Name field in each DB. My entry should be
Roladex: join1, Name
Cardscan: join1, Name (Name being an example element)

(what am I doing wrong. Error: A field cannot contain more than one element to be inserted, but otherwise the Inserted table is empty).

I have One PHONE element in the destination table (Roladex) and need to combine about five in the source table (Cardscan).

Forgetting the join issue for a moment, Roladex reads (F5)Phone+ (OR +(F5)Phone ?)(syntax error) and all of the files to be included from Cardscan read (F5)Phone (Syntax Error)

Or Roladex|Phone (destination) Phone contains Example element Phone and Cardscan|phone1 , Cardscan|phone2 etc contain Example element Phone+ or +Phone ...(syntax error).

So...what am I doing wrong..or, to make things easier, what right? What do I do with the ^%$##%& +, if anything (Without it there is an empty table..and with it probably too.) Join don't do it for the tables.


Gracias.

(Once this is done I'll make a backup of the miracle table - and try the case changing magic script).


 
duh
(lightbulb above head) - Each element in the source table has a distinct name...so the plus is phone+phone1+phone2 ...
so far so good, but that doesn't explain why the priv:insert only shows twenty records from the source table...
 
Why don't you paste the actual query for us to look at. Usually the 'join1' is the default example element placed by Paradox when you use the Join Button instead of doing it manually.

Mac :)

"Do not delve too deeply in the arts of your enemy and so become ensnared by them"

langley_mckelvy@cd4.co.harris.tx.us
 
Actually, it worked. I can't figure out why it didn't before, but I have everything all right so far (I hope)

Here is the query, none the less.

Query
ANSWER: :pRIV:ANSWER.DB

newrol.DB | NAME | DATE | TELEPHONE | FAX |
Insert | _Name | _Date | _Phone | _Fax+_Fax1+_Fax2 |

newrol.DB |
Wphone

|
|
_Workphone+_Workphone1+_Workphone2+_Workphone3+_Workphone4+_
Workphone5+_Workphone6+_Workphone7+_Workphone8+_Workphone9+_
Workphone10+_Workphone11 |


newrol.DB | Cell-pgr | E-
MAIL | Address |
| _Mobile+_Mobile1 |
_Email+_Email1+_Email2+_Email3 | _Address |

newrol.DB | CITY | STATE | ZIP | Country | LOCATION |
TITLE |
| _City | _State | _Zip | _Country | _Location |
_Title |

newrol.DB | INFORMATION | Type | Source |
| _Other+_Notes | _Type | _Source |

Cardscan.DB | Name | Title | Company | City | State |
Zip | Country |
| _Name | _Title | _Location | _City | _State |
_Zip | _Country |

Cardscan.DB | 2ndAddress | Phone | Fax | AltFax |
DirectLine |
| _Address | _Workphone | _Fax | _Fax1 |
_Workphone1 |

Cardscan.DB | HomePhone | HomeFax | MainPhone | Mobile |
Pager |
| _Phone | _Fax2 | _Workphone2 | _Mobile |
_Mobile1 |

Cardscan.DB | Phone415 | SalesPhone | Toll Free |
Phone1 |
| _Workphone3 | _Workphone4 | _Workphone5 |
_Workphone6 |

Cardscan.DB | Phone2 | Phone3 | Phone4 |
Phone5 |
| _Workphone7 | _Workphone8 | _Workphone9 |
_Workphone10 |

Cardscan.DB | Phone6 | Email | Web | Emailhome |
Email1 | Notes |
| _Workphone11 | _Email | _Email1 | _Email2 |
_Email3 | _Notes |

Cardscan.DB | Other | Categories | CreationDate | Source
|
| _Other | _Type | _Date | _Source
|

EndQuery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top