Remove the red part below:SELECT Year(t_odat) as Year, SUM(t_amta) as Spend, ( SELECT SUM(t_amta) FROM ttipcs360100 WHERE t_cprj = cast(t_orno as char(6))) as Spend2FROM ttdsls041100 INNER JOIN ttiitm001100 ON ttdsls041100.[t_item] = ttiitm001100.[t_item]WHERE t_orno >= 800000 AND t_orno <= 879000 AND t_cuno = ' 0004'GROUP BY Year(t_odat), t_ornoORDER BY Year(t_odat)
You are grouping by t_orno which is likely causing your issue.
Poor planning on your part does not constitute an emergency on my part.