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

Get Conditional Statement in SQL

Status
Not open for further replies.

anitalulu

Programmer
Nov 19, 2002
23
HK
I have use a table to store the conditional Statement as follow.

CommissionTable

CommissionRate ConditionalStatement
0.03 Sales < 50
0.05 Sales >= 50 And Sales < 80
0.06 Sales >= 80 And Sales < 100
0.07 Sales >= 100 And Sales < 120
0.08 Sales >= 120

I want to calculate the commission when the sales revene in the above percentage.

For i = 0 To dsRate.Tables(0).Rows.Count - 1
If dsRate.Tables(0).Rows(i).Item(1).ToString() Then
Commission = salesRevenue * dsRate.Tables(0).Rows(i).Item(0)
Exit For
End If
Next


How can I extract the conditional statement in the database?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top