Solved

How to prevent the 0 with a Ladder type payout

Posted on 2014-07-31
2
24 Views
Last Modified: 2015-06-04
If I have the tables below and Salesman SalesP sells 42 items and I use a Case Statement of
Case When Items >= S and <= E Then Win else '0' end as Payout I get 3 results 0,0 and 250. Now I know why I get that
but how can I Not get the 0's. Of course if the items were 10 I would want 0, but just one of them?


Salesman table
SalesP      Items
1      42        

Payout table
S      E      Win
30      39      200
40      49      250
50      59      300
0
Comment
Question by:SeTech
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 40231626
<wild guess, not sure there's enough into to answer this question>

SELECT s.SalesP, p.Win
FROM Salesman s
   JOIN Payout p ON s.Items BETWEEN p.S AND p.E
WHERE s.SalesP = 1

Open in new window

0
 
LVL 15

Expert Comment

by:Vikas Garg
ID: 40231629
Hi,

Not very clear with your question..

Can you take some sample data and explain pls ?
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question