PC Review


Reply
Thread Tools Rate Thread

create table mathematically

 
 
=?Utf-8?B?cndpbmFucw==?=
Guest
Posts: n/a
 
      29th Mar 2007
I have created a database to track sales of a product and to determine
commissions for the sales team. Each quarter I print a report outlining the
commission scales for each salesperson. This scale differs based on how many
sales were made the previous quarter. I would like to have a database table
(tblVipScale) that defines the commissions mathematically (scale base, scale
increment, commission base, commission increment and maximum commission).
From a form, I have a command button that creates a report for each sales
rep. I want that command button to be coded to also create a table based on
the information in tblVipScale for use in the report, sort of like a make
table query. I am not very good at coding, but below I have outlined what I
need to do. Can someone please help with a create table command?

*tblVipScale contains fields ScaleName (Primary Key), ScaleBase,
ScaleIncrement, CommissionBase, CommissionMax, CommissionIncrement*

If CommissionIncrement = 0 Then
Calc = 1
Else
Calc = ((CommissionMax – CommissionBase) / CommissionIncrement) + 1
ScaleVar = 0
CommissionVar = 0

Build a table called tblScale with fields Scale and Commission

Loop 1 to Calc
ScaleLow = ScaleBase + ScaleVar
ScaleHigh = ScaleLow + ScaleIncrement – 0.1
Scale = ScaleLow & “ – “ & ScaleHigh
Commission = CommissionBase + CommissionVar
Populate tblScale with Scale and Commission
ScaleVar = ScaleVar + ScaleIncrement
CommissionVar = CommissionVar + CommissionIncrement
End Loop

Example of a result would look like this:

Scale Commission
100-104.9% 1%
105-109.9% 2%
110-114.9% 3%

Thanks in advance for any suggestions.
Rick
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Mathematically Unbeatable Home Business circle5003 Windows XP General 4 18th Sep 2009 01:24 PM
Is there a way to mathematically size the rows and columns in a ta sheana Microsoft Word New Users 6 6th Feb 2008 11:49 PM
Create Table mathematically =?Utf-8?B?cndpbmFucw==?= Microsoft Access 0 29th Mar 2007 01:54 PM
To have month and year as part of the table name in CREATE TABLE or MAKE TABLE Query ichew@scs.com.sg Microsoft Access Getting Started 1 18th Apr 2006 06:38 AM
Create Table Primary Key after Make Table Query And Update Table =?Utf-8?B?Uk5VU1pAT0tEUFM=?= Microsoft Access Queries 1 3rd May 2005 08:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:30 PM.