Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 little advice with an If, then, else statement?

Author  Topic 

darthasshat
Starting Member

17 Posts

Posted - 2004-05-23 : 18:45:32
Hello all, I'm new here and was wondering if you could help me out. First i'll describe what I need to do and then how I intend to get the information. Perhaps one of you can let me know if I'm out of my mind or on the right track.

A collegue of mine is trying to build a query from commission data. Here is the issue, The data is based on rate codes added to an account on any given change of service. If the quantity of said service code goes from quantity 0 to 1, we pay the commission based on that revenue generating unit. The problem is the billing system we have prevents us from changing service if there is a promotion on the account so in order to make a change, you have to remove services to to break the campaign in order to make a change. what happens is we are paying agents for selling existing services. The table looks like this:

-----------------Quantity from: \ Quantity to:
rate 1------------------1-------------0
rate 1------------------0-------------1

What we need to do is filter out these occurences so we don't pay more than we should. I recommended an nested if/then else statement. In other words, if quantity from of rate 1 = 0, then delete all occurences of rate 1. Else move on to next rate code.

What do guys think? Would it work? Does anyone have any suggestions? Any help would be extremely appreciated! Thank you all for your time.
   

- Advertisement -