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

APPEND FROM with FOR statement not working

Status
Not open for further replies.

dduva

Programmer
May 16, 2001
38
US
Table A has records. Table B is blank.

I want to append from table A to table B the records which satisfy a statment.

SELECT B
APPEND FROM A FOR A.NUMBER = 8034

There are 12 records in table A, I should be appending 3 records to table B. I am getting 0 records. If I change the NUMBER field in the first record in file A to 8034 I get all 12 records appended.

What am I doing wrong?

Thanks
 
HI


SELECT B
APPEND FROM A FOR NUMBER = 8034

This shall work. Dont use "A.Number = "

This shall solve your problem :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
The following is from The Hacker's Guide: "The FOR clause of APPEND FROM looks at each record as if it had already been added to the table in question and evaluates the condition in that situation."

So if the first record in A doesn't have a.number = 8034, you'll get none, and if it is you get all of the records appended!

Try:
APPEND FROM A FOR NUMBER = 8034

Obviously this assumes you have a NUMBER field in B.

Rick
 
You should leave off the alias name:

SELECT B
APPEND FROM A FOR NUMBER = 8034

Dave S.
 
Swarm of vultures on that one eh? I guess that's better than none at all. :)

Dave S.
 
Very true DSummZZZ.

Thanks everyone.
 
Dave,
It really means that a lot of us have been "burned" on this one, and it's easy to fix once you've spent the time figuring it out!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top