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

Dividing percentages evenly 1

Status
Not open for further replies.

gaperry

IS-IT--Management
Jan 29, 2002
37
0
0
US
Hi all,

I have a number that I need to divide accross a group of percentages.

Example: $1000 - Need to spread this number accross the following percentages 60%,30% & 10% to find the correct $$$ value for each.

Note that the total percentage will always be %100. There are several fields that could contain a percentage number but the percentage overall will always total %100 which means some fields will be null values or contain no percentage to calculate against.


Any help here is appreciated,

Thanks.

 
SELECT tblValuesAcrossFields.EntryID, tblValuesAcrossFields.Amt, tblValuesAcrossFields.Pct1, tblValuesAcrossFields.Pct2, tblValuesAcrossFields.Pct3, tblValuesAcrossFields.Pct4, [Amt]*([Pct1]/100) AS Expr1, [Amt]*([Pct2]/100) AS Expr2, [Amt]*([Pct3]/100) AS Expr3, [Amt]*([Pct4]/100) AS Expr4
FROM tblValuesAcrossFields;

My data looked like this.
Code:
EntryID  Amt  Pct1   Pct2   Pct3   Pct4
A   1500   35   35   0   30
B   2000   22   35   10   33
C   1000   60   30   0   10

The answers came out correctly.  I only used whole numbers so I didn't test for percentages like  25.75%


Paul
 
PaulBricker,

thanks ! exactly what I was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top