I'm trying to update a field (status_code) in one table (p_temp_merged_file) by accessing a column (status_code)in another table (p_pha_plan). The update statement is not working and I am not all that familiar with SQL. I wasn't sure if a select statement was needed or if I needed to join the tables in order to do an update. Any help would be appreciated. My code is as follows:
Conn.Execute "UPDATE p_temp_merged_file "_
&"SET p_temp_merged_file.status_code=PLAN_ALREADY_APPROVED "_
&"WHERE p_pha_plan.status_code=APPROVED "_
&"AND p_temp_merged_file.state_code=p_pha_plan.state_code "_
&"AND p_temp_merged_file.pha_code=p_pha_plan.pha_code "_
&"AND p_temp_merged_file.fiscal_year=p_pha_plan.fiscal_year"
This is an easier one, but it won't work either...
UPDATE p_temp_merged_file " _
SET status_code=READY_TO_SUBMIT_FOR_APPROVAL " _
WHERE status_code=PHA_PLAN_PDF_FILE_CREATED "
Any help would be greatly appreciated!
Conn.Execute "UPDATE p_temp_merged_file "_
&"SET p_temp_merged_file.status_code=PLAN_ALREADY_APPROVED "_
&"WHERE p_pha_plan.status_code=APPROVED "_
&"AND p_temp_merged_file.state_code=p_pha_plan.state_code "_
&"AND p_temp_merged_file.pha_code=p_pha_plan.pha_code "_
&"AND p_temp_merged_file.fiscal_year=p_pha_plan.fiscal_year"
This is an easier one, but it won't work either...
UPDATE p_temp_merged_file " _
SET status_code=READY_TO_SUBMIT_FOR_APPROVAL " _
WHERE status_code=PHA_PLAN_PDF_FILE_CREATED "
Any help would be greatly appreciated!