0 pts.
 Sql
When I execute this Sql command. I get an error "Column BASEDATA1 not in specified tables." I have a field in IN$FPS00 that I want to include in 'where' condition and update the rest of the fields in this file. Field Basedata1 is in the table. UPDATE IN$FPS00 SET I@R01 = Sum(BaseData1) WHERE EXISTS(Select BaseData1 FROM si280061 a, si280062 b,in$fps00 c WHERE a.hierarchyid=b.hierarchyid) AND (datatype='SI') AND (salesinfotype IN ('I01','I04' )) AND hlevel20=fp$sku)

Software/Hardware used:
ASKED: March 28, 2006  2:56 PM
UPDATED: March 29, 2006  1:32 AM

Answer Wiki:
You used: UPDATE IN$FPS00 SET I@R01 = Sum(BaseData1) WHERE EXISTS(Select BaseData1 FROM si280061 a, si280062 b,in$fps00 c WHERE a.hierarchyid=b.hierarchyid) AND (datatype='SI') AND (salesinfotype IN ('I01','I04' )) AND hlevel20=fp$sku) You're trying to pull BaseData1 from one of the SI files, but you're specifying that it should come from IN$FPS00. You're also using more copies of in$fps00 than you think. I would rewrite the code for you, but you must do these things first: (1) Balance your parentheses (2) Qualify all names. For instance, datatype should be a.datatype, b.datatype, or c.datatype. --- Sheldon Linker (sol@linker.com) Linker Systems, Inc. (www.linkersystems.com) 800-315-1174 (+1-949-552-1904)
Last Wiki Answer Submitted:  March 29, 2006  1:32 am  by  SheldonLinker   15 pts.
All Answer Wiki Contributors:  SheldonLinker   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _