473,500 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i want to calculate base on condition

1 New Member
i have an quary
select we.wip_entity_name job_number,
wmt.transaction_date,
bd.department_code,
wmt.TRANSACTION_QUANTITY

From wip_move_transactions wmt,
wip_entities we,
bom_departments bd


where wmt.wip_entity_id = we.wip_entity_id
AND wmt.organization_id = we.organization_id
AND wmt.fm_department_id = bd.department_id
AND we.wip_entity_name = '24E/125914'

output result is

JOB_NUMBER TRANSACTION_DATE DEPARTMENT_CODE TRANSACTION_QUANTITY
24E/125914 5/5/2011 17:36 FAB 14
24E/125914 4/23/2011 15:35 FAB 10
24E/125914 9/9/2011 12:35 FAB 1

now i want to add parameter using TRANSACTION_date, if i will pass 5/5/2011 TRANSACTION_QUANTITY will return sum of 10+14 = 24 according job_number
Mar 7 '12 #1
1 1354
r035198x
13,262 MVP
In your example quantity 14 is for date 4/23/2011 so why should it be returned?
It looks like you need to select JOB_NUMBER, TRANSACTION_DATE, sum(TRANSACTION_QUANTITY ) ...group by JOB_NUMBER, TRANSACTION_DATE

but watch out for those time parts in your database dates.
Mar 7 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2329
by: Teis Draiby | last post by:
I want to write a base class that includes a member function that creates an instance of a derrived class and returns a pointer to it. Problem: The derived class definition has to follow the base...
4
1244
by: Frank Rizzo | last post by:
In some examples with inheriting, I see the overloaded function always call its base. For instance, in this case where the ListView control is being extended. public class ListViewEx :...
4
1593
by: kelvinweb | last post by:
Hi All, My Source Code is the following <ItemTemplate> <tr> <td width="100" align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;</font></td> <%IF...
6
2063
by: luanhoxung | last post by:
dear all!! i met the headache problem in setting value for some controls in my form. i have 2 combo box in form F1. i want to set value for some textbox in F1 when i choose value from 2 combo...
6
4266
by: Peter Lee | last post by:
class Base { public: void t1() {} void t2() {} void t3() {}; }; class Derived : public Base
6
27758
by: bryanbabula | last post by:
I have a question about overriding i was wondering if anyone could help me with, or even suggesting a better/different way. I have no idea if this can even be done or not. I was wondering if there...
3
10718
archulu
by: archulu | last post by:
hai this is archulu. i am new to domapi.now my problem is in my project i am taken 2 domapi datepickers. what i am want Calculate duration between two dates which i am selected in that datepicker. ...
15
3811
by: Bob Johnson | last post by:
I have a base class that must have a member variable populated by, and only by, derived classes. It appears that if I declare the variable as "internal protected" then the base class *can*...
5
3230
by: zivon | last post by:
Hello everyone ! I made a price calculator for a guest house. I have diffrent sale campaigns, all the time, I made a table with campaign name and discount, for example: name "pensioners"...
1
2445
by: rakeshnair | last post by:
i wrote a code in jsp to create dynamic table..the problem is i need data base connection when cursor moves from one cell to other... eg...when i enter product id in the first cell, the product name...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.