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

Case Statment

Status
Not open for further replies.

KatGraham

Programmer
Feb 12, 2003
58
US
How do I write a Case Statment to convert Salary into Annual Salary and then code the salary into Salary Bands?

Fields in Table
salry salry_mode
1,000 B
500 W

tblSalaryDecode
salry_mode description
B Bi-weekly
W Weekly

tblSalaryBand
1 <=$40,000
2 $40,001 - $80,000
etc.

I think the best was is to do a Case Statment. I tried:

Function SalaryAnnual(salry_mode, salry_amt)
Select Case salry_mode
Case Is = &quot;B&quot;
SalaryAnnual = salry_amt * 26
Case Is = &quot;M&quot;
SalaryAnnual = salry_amt * 12
Case Is = &quot;S&quot;
SalaryAnnual = salry_amt * 48
Case Else
SalaryAnnual = salry_amt * 52
End Select
End Function

In a query I tried:

curSalaryAnnual: SalaryAnnual([salry_mode,salry_amt])

but I get an error message: wrong # of arguments used.

HELP!
 
Hello,

I think you need this:

curSalaryAnnual: SalaryAnnual([salry_mode],[salry_amt])

Good Luck!

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top