This SQL when trying to execute shows the ERROR message: (Invalid Column Name Job_Operation.Est_Run_Hrs). I have viewed the statement and unable to see the problem with the code.
SELECT Job_Operation.Job, Job_Operation.Work_Center, Job_Operation.Est_Run_Hrs, Job_Operation.Act_Run_Hrs, [Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs] AS [HRS VAR], Job.Status, Job_Operation_Time.Employee, Job_Operation_Time.Work_Date, ([Job_Operation.Est_Run_Hrs]/([Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs]))*100 AS [% VAR]
FROM Job INNER JOIN (Job_Operation INNER JOIN Job_Operation_Time ON Job_Operation.Job_Operation = Job_Operation_Time.Job_Operation) ON Job.Job = Job_Operation.Job
WHERE (((Job_Operation.Work_Center)='DESIGN') AND ((Job.Status)='ACTIVE') AND ((Job_Operation_Time.Work_Date)=Getdate()-1) AND ((([Job_Operation.Est_Run_Hrs]/([Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs]))*100)>25))
ORDER BY ([Job_Operation.Est_Run_Hrs]/([Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs]))*100;
SELECT Job_Operation.Job, Job_Operation.Work_Center, Job_Operation.Est_Run_Hrs, Job_Operation.Act_Run_Hrs, [Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs] AS [HRS VAR], Job.Status, Job_Operation_Time.Employee, Job_Operation_Time.Work_Date, ([Job_Operation.Est_Run_Hrs]/([Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs]))*100 AS [% VAR]
FROM Job INNER JOIN (Job_Operation INNER JOIN Job_Operation_Time ON Job_Operation.Job_Operation = Job_Operation_Time.Job_Operation) ON Job.Job = Job_Operation.Job
WHERE (((Job_Operation.Work_Center)='DESIGN') AND ((Job.Status)='ACTIVE') AND ((Job_Operation_Time.Work_Date)=Getdate()-1) AND ((([Job_Operation.Est_Run_Hrs]/([Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs]))*100)>25))
ORDER BY ([Job_Operation.Est_Run_Hrs]/([Job_Operation.Act_Run_Hrs]-[Job_Operation.Est_Run_Hrs]))*100;