Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with expression and sql statement

Status
Not open for further replies.

jeevenze

Technical User
Mar 13, 2001
62
US
I have the following query:

SELECT qryporeceived.job_number, qryporeceived.SumOfpo_received, tbljob_info.total_estimate
FROM qryporeceived INNER JOIN tbljob_info ON qryporeceived.job_number = tbljob_info.job_number
GROUP BY qryporeceived.job_number, qryporeceived.SumOfpo_received, tbljob_info.total_estimate;


This returns the fields, 'job-number', 'SumOfpo_received' and 'total_estimate'.
I need help writing a query where there's a field that returns the result of total_estimate - SumOfpo_received. (i.e. subtract SumOfpo_received from total_estimate)

I'd be thankful for any responses.
Thank you

Jeevenze
 

Here is an example.

SELECT
qryporeceived.job_number,
qryporeceived.SumOfpo_received,
tbljob_info.total_estimate,
(tbljob_info.total_estimate - qryporeceived.SumOfpo_received) As Diff
FROM qryporeceived INNER JOIN tbljob_info ON qryporeceived.job_number = tbljob_info.job_number;

Is there a reason for the Group By statement in your query? I removed it in this example as I see no aggregate functions in use. Terry
Please review faq183-874.

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top