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

concatination of two alphanumeric fields in place of existing field.

Status
Not open for further replies.

jlockley

Technical User
Nov 28, 2001
1,522
US
I know there's an easy way to do this with changeto, but I need detail help:

I have imported information from Cardscan and and Corel database into the same pdox file. Each handles names differently (last first/first last)but both also have separate first and last fields .I therefor want to replace the existing name field with the last name (space, no comma) first name using a query.

I know this is easy, but I am missing the turn somewhere. How do I handle this? It sounds like this using the query form (I am not up to coding queries..sorry):
[2000.name], changeto [2000.Last Name] || [2000.First Name]
or

[2000.name], changeto [2000.Last Name]+ [2000.First Name]

or:
.., changeto [2000.Last name] || etc

The first has no success. The leaves every record with [2000.Last Name] [2000.First Name] - so how do I get it to concatinate two fields into a third?

(I know that I am going to bang my head against the desk when I see the answer.)




 
jlockley,

Use a QBE query:

Code:
Tablename.db | First Name | 
             | _fn        | 
             
Tablename.db | Last Name               |
             | _ln, changeto _ln + _fn |

Remember that Paradox returns the CHANGED records after a changeto query. If you run this, then, and see the "original" data, take another look at the name in the titlebar. It should be CHANGED.DB. This is a temporary table containing the original data and serves as a backup in case you make a mistake.

To verify the actual changes, you'll need to re-open the original table.

Hope this helps...

-- Lance
 
OK - did I mention "duh"? I've got two things. After some late night reading I get the feeling that the CALC operator would actually be the more appropriate method of combining strings - So I should be able to get my results by writing calc First Name+" "+Last Name (maybe the space is an issue?) without the brackets. The result, however, reads
val: 2000.Last Nameval: field:2000.First - I am obviously missing something here which you all know.

The second issue is a little more embarrassing: I have been using Pdx since right after the rocks cooled stumbling about and occasionally even learning something, but for me a query is a long scrolling bar with check boxes.

I Don't understand the process you all keep mentioning here
Use a QBE query:

Tablename.db | First Name |
| _fn |

Tablename.db | Last Name |
| _ln, changeto _ln + _fn | etc--

Obviously this can and should be learned, but do I write this in notepad as namechange.qbe and then run it or...? Not dumb, just enormously ignorant.



Thanks.
 
Pretty much. However, you need to write the whole query if you do it that way.

Query
ANSWER: :pRIV:ANSWER.DB

Tablename.db | First Name |
| _fn |

Tablename.db | Last Name |
| _ln, changeto _ln + _fn | etc--

EndQuery

The underscores indicate example elements. If you do it interactively with the QBE tool, <F5 key> + fn would be the same as _fn in the manual query.

 
Much obliged. Encouraged I renamed the query to .txt and opened.

I figured out at least one of the issues not working. It did go with calc, but it would only append a new field, not change an existing. I think I was missing an example element, or some such thing.

The lesson is very much appreciated.

jlockley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top