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

INSERT INTO and Select statement

Status
Not open for further replies.

montejr

Programmer
May 24, 2001
42
0
0
US
Gang,
I am trying to populate the records of one field based on the value of another field. So if I have a value of 1 as my plan_id, I want the value of my Plan_Name to be plan1.

Essentially, I need to write a query to select a bunch of records and populate another field with new values based on the selected records. Here is my syntax so far:

INSERT INTO PascoCounty_Parcels (Plan_Name) VALUES (Plan1) SELECT * from PascoCounty_Parcels where PlanID = 1;

I get a "missing semicolon at end of SQL Statement" message. I think my syntax is wrong - it's been a while since I have done this.

Thanks,
Monte
 
since it appears you are working on the same table I think what you are really looking for is an update query

UPDATE PascoCounty_Parcels SET Plan_Name = "plan1"
WHERE PlanID = 1;

 
Gol4,
Thanks so much for the help. You are a life saver. Big demo coming up and this solved my problem. I cannot thank you enough.

Cheers,[afro2]
Monte
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top