|
-
Dec 28th, 2005, 11:15 AM
#1
Thread Starter
Lively Member
SQL query help
I have 2 tables
JOBS
JOBNO HRSWORKED
111 12
111 1
111 3
222 4
222 6
JOBLT
JOBNO BUDGETEDHRS
111 20
222 10
SELECT JOBNO, BUDGETEDHRS, (SELECT SUM (HRSWORKED) FROM JOBS WHERE JOBS.JOBNO= JOBLT.JOBNO GROUP BY JOBS.JOBNO ) AS TOTALHRSWORKED , (TOTALHRSWORKED-BUDGETEDHRS) AS OVERBUDGET
FROM JOBLT ORDER BY JOBNO
Here I am getting the error TOTALHRSWORKED as invalid column
How can I fix that?
thx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|