[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

QuickReport Question (SQL Also)

Posted on 1997-09-26
5
Medium Priority
?
175 Views
Last Modified: 2013-11-22
Hi,
I need to create a report and heres the problem and what needs to be done:

I have a database of items we shipped.
There is a main id which is by customer and under that there are item ids. for every item there is a cost. the main number is how the tables are linked. I have whriten an sql which successfully lists all the clients and items chipped for a day but now I need an option to make a filter for the Query that would select all the clients and all the item ids
where the total cost for ALL the item ids under the customer is <= 0.

Heres what it should look like in the end

Client/Item ID                 Date         Price
1234567
         01234567              ../../..     00.00
         12345678              ../../..     00.00

The filter MUST exclude all the client ids that have the sum of all the item ids totalling >0.2.

My current filter, for some reason, works but the problem is that it does exclude all the itemid's without the right price BUT it doesnt exclude the other ids associated with that client or the client id itself.

Please Help as This is VERY urgent.
If you need more info,
Please E-Mail me at:
maxcom@interserv.com
0
Comment
Question by:MAXcom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Expert Comment

by:d4jaj1
ID: 1346357
Whom ever answers this question, please take a look at a very simular question dated 9/, since I think the answer would apply to both questions.  MAXcom, I hope you don't mind me piggy-backing on your question, but I think the questions are the same and I need an answer really fast also.
0
 
LVL 22

Expert Comment

by:pivar
ID: 1346358
Hi MAXcom,

I think you have to tell us which tables you have and how they  look likes.

/pivar
0
 
LVL 1

Accepted Solution

by:
dionysos_swamp earned 510 total points
ID: 1346359
I would assume that you have two tables:
client(main_id,blablabla)
and
goods(main_id,date,price,blalbllblb)

to get all the clients that have received goods for <= 0 the sql would be something like:

select * from client c, goods g where
 c.main_id=g.main_id and
 ((select sum(price) from goods sg
   where sg.main_id=c.main_id) <= 0)

cool?

0
 

Author Comment

by:MAXcom
ID: 1346360
Thanks,
Even though the sql you gave me didnt work by converting it straight to the real tables, it did get me on the right track.
MAXcom
maxcom@interserv.com
0
 
LVL 1

Expert Comment

by:dionysos_swamp
ID: 1346361
Glad to have been of service.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 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