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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you SUM of Calculated field?

Status
Not open for further replies.

tbonehwd

IS-IT--Management
Jul 28, 2005
45
US
For example:

Select Sum(ORDERS.UNITS) as UNITS_PURCH, Sum(RETURN.UNITS) as UNITS_RET, Sum [UNITS_PURCH]-[UNITS_RET] as NET_UNITS

I am just curious if you can sum a previously calculated field and if so what is the correct syntax?

Thanks,

TBonehwd
 
Wouldn't NET_UNITS just be one value? I don't see why you'd need to sum it.

[UNITS_PURCH]-[UNITS_RET] as NET_UNITS
 
Hi!

Like this:

Select Sum(ORDERS.UNITS) as UNITS_PURCH, Sum(RETURN.UNITS) as UNITS_RET, Sum Sum(ORDERS.UNITS) - Sum(RETURN.UNITS) as NET_UNITS

Of course, if you plan on using this in a report then it might be quicker to do the calc in a text box. Then you could us UNITS_PURCH and UNITS_RET.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Thank you, I take it you can't just Sum a previously calculated field.
 
Correct, to answer your general question, Access doesn't seem to like that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top