Notes Calculation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on an access report where I have one coloumn called Reward, its
currency, now I want to create some more colomns to calculate the no of
20,10,5 pound notes in that reward. so first column wil be where I want to
calculate the no of 20 pound notes in that reward, and then in the next
coloumn no of 10 pound notes and so on. can any body help, advance thanks
 
Sherry,
I take it that each Rewards will contain either 20, 10, or 5...
In the query behind the report I'd create 3 calculated columns. First,
to handle 20's
20Count : IIF(Rewards = 20, 1, 0)
and so on for each denomination.
Place these 3 columns on your report, and do a
= Sum(20Count)
wherever you choose to "break" the data.
hth
Al Camp
 
UNTESTED, but I think that the following might work for you. Although I might
have misunderstood what you want.

SELECT Reward,
Reward\20 as Count20,
(Reward mod 20)\10 as Count10,
(Reward Mod 10)\5 as Count5,
(Reward Mod 5) as Count1
FROM YourTable

If you want the number of 5's in reward then just do the integer division
Reward\5 vice (Reward Mod 10)\5

With 46 the first returns 9 and the second returns 1

Hope this helps.
 
Back
Top