calculating problem

K

Kayak

hi all

i have table Transaction as below
TransID ProductID ResaleCost PriceCost Quantity
1 4 $100 $91 9
2 5 $150 $145 10
3 1 $50 $44 2
4 4 $450 $430 46
5 2 $615 $600 30
6 1 $51 $44 2
7 6 $440 $432 7
8 4 $255 $245 25
i created query Profit as below:
SELECT Transaction.TransID, ([ResaleCost]-[PriceCost])/
[Quantity] AS Profitperunit FROM Transaction ;



Now i want to create new query such that it will calculate
only 60%,50% and 40% of total records by order of
Profitperunit descending. So the outcome should be like

persentage TransID Profitperunit
60% 1 $1
50% 1 $1
40% 7 $1.14

calculation:
60%*8(total records)=4.8 >> row#4 >>transID = 1
50%*8=4 >> row#4 >> transID= 1
40%*8=3.2 >> row#3 >> transID =7

please help...
 
J

John Vinson

Now i want to create new query such that it will calculate
only 60%,50% and 40% of total records by order of
Profitperunit descending.

Set the Top Values property of the query (right mouseclick the grey
background of the tables, or select View... Properties, or click F4)
to 60, and check the Percent checkbox.
 
K

Kayak

but its gave me total range from x% below whereby now i
want only the exact data for that particular x%
 

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