Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to prevent the 0 with a Ladder type payout

Posted on 2014-07-31
2
Medium Priority
?
32 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 66

Accepted Solution

by:
Jim Horn earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

926 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