calculation query

N

Need Access Help

I want to creat a query or query part or field that takes information out of
a query and totals all of that information. for example i have a query that
finds all the products sold in 2007, one of the fields is the units cost, i
want the query to total all of the items unit cost, or have another query
that pulls the costs and totals them, how do i do this
 
S

Steve

Are you sure you do not want to total (Quantity * UnitCost)?

To answer your question ---
Your query needs two fields. Put the following expression in the first field
of the query:
SalesYear:Year([NameOfTheSalesDateField])
Set the criteria for this field as 2007.
Put UnitCost in the second field.
With the query in design view, click on the Sigma button (looks like capital
E) in the menu at the top of the screen. Under UnitCost, change Group By to
Sum.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
N

Need Access Help

i tried the information you gamve me but it did not work. i dont know if i
needed to give you this information but the query has a field that is unit
costs, i want the sum of this field. also i have a filed that is set to pull
up information that takes place between two dates in one of the fileds

Steve said:
Are you sure you do not want to total (Quantity * UnitCost)?

To answer your question ---
Your query needs two fields. Put the following expression in the first field
of the query:
SalesYear:Year([NameOfTheSalesDateField])
Set the criteria for this field as 2007.
Put UnitCost in the second field.
With the query in design view, click on the Sigma button (looks like capital
E) in the menu at the top of the screen. Under UnitCost, change Group By to
Sum.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)





Need Access Help said:
I want to creat a query or query part or field that takes information out
of
a query and totals all of that information. for example i have a query
that
finds all the products sold in 2007, one of the fields is the units cost,
i
want the query to total all of the items unit cost, or have another query
that pulls the costs and totals them, how do i do this
 
O

Ofer Cohen

You can use

with code:
DSum("[units cost]","QueryName")

Or SQL in a new query
Select Sum([units cost]) As SumOfunits_cost From QueryName

Hope that what you mean
--
Good Luck
BS"D


Need Access Help said:
i tried the information you gamve me but it did not work. i dont know if i
needed to give you this information but the query has a field that is unit
costs, i want the sum of this field. also i have a filed that is set to pull
up information that takes place between two dates in one of the fileds

Steve said:
Are you sure you do not want to total (Quantity * UnitCost)?

To answer your question ---
Your query needs two fields. Put the following expression in the first field
of the query:
SalesYear:Year([NameOfTheSalesDateField])
Set the criteria for this field as 2007.
Put UnitCost in the second field.
With the query in design view, click on the Sigma button (looks like capital
E) in the menu at the top of the screen. Under UnitCost, change Group By to
Sum.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)





Need Access Help said:
I want to creat a query or query part or field that takes information out
of
a query and totals all of that information. for example i have a query
that
finds all the products sold in 2007, one of the fields is the units cost,
i
want the query to total all of the items unit cost, or have another query
that pulls the costs and totals them, how do i do this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top