Items have a fixed price of $10 per unit. Use a Select Case statement to implement the following sales commission schedule:
Fewer than 10 items sold = 1% commission
Between 10 & 40 items sold = 2% commission
Between 41 & 100 items sold = 4% commission
More than 100 items sold = 8%
Numbers of items sold
I keep getting "End of statement expected" error...underlined below;Public Class SalesCommissionCalculatorForm
Dim Commission As Object
Dim Price As Double
Private Property caseCode As Double
Private Property ItemsSold As Object
' handles calculateButton_Click event
Private Sub calculateButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles calculateButton.Click
Dim caseCode Ad Integer ' stores case code entered
Dim message As String ' displays access status of users
caseCode = Val(caseCodeTextBox.Text)
Select Case ItemsSold
Case Is < 10
Commission = Price * 0.01
Case Is < 41
Commission = Price * 0.02
Case Is < 101
Commission = Price * 0.04
Commission = Price * 0.08
End Class ' SalesCommissionCalculatorForm
- Moved by Naomi N Sunday, January 19, 2014 1:55 AM VB question - OP has a simple typo in the code
Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.
This is minimal polite behavior on SQL forums. What you did post is garbage and in the wrong forum. Do not Internet while drinking or texting :)
CREATE TABLE Sales
(transaction_nbr CHAR(10) NOT NULL,
sale_qty INTEGER NOT NULL
CHECK (sale_qty > 0),
(CASE WHEN sale_qty < 10 THEN 0.01
WHEN sale_qty BETWEEN 10 AND 40 THEN 0.02
WHEN sale_qty BETWEEN 41 AND 100 THEN 0.04
ELSE 0.08 END),
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in Sets / Trees and Hierarchies in SQL
- Proposed as answer by Naomi N Sunday, January 19, 2014 1:54 AM
1) This is a T-SQL forum, which may explain why on one has answered your post yet.
2) You have a simple typo on the problematic line, "Ad" instead of "As".
Erland Sommarskog, SQL Server MVP, firstname.lastname@example.org
I marked this reply as answer becasue the point 2 may solve your issue:
change "Ad" to "As"
If still no helping, you could feel free to let us know.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.