Click here to Skip to main content
16,021,209 members

Comments by sk. maqdoom ali (Top 86 by date)

sk. maqdoom ali 18-Feb-13 0:34am View    
i written the following query

(select sum(Qty_FTD) from Production_Details pr where Material_Id=@MaterialType AND Production_Type=@ProductionType and pr.Last_Updated <= pr.Last_Updated )
i am getting output as
Prod_Type Chainage Material_Id QTY_Cumilative
1 192 2 1830
1 247 2 1830
sk. maqdoom ali 17-Feb-13 23:43pm View    
i written the following query.
(select sum(Qty_FTD) from Production_Details pr where Material_Id=@MaterialType AND Production_Type=@ProductionType
and pr.Last_Updated <= pr.Last_Updated )

i am getting output as
Prod_Type Chainage Material_Id QTY_Cumilative
1 192 2 1830
1 247 2 1830
sk. maqdoom ali 17-Feb-13 23:37pm View    
hai,, gd mrng
how to calculate Cumulative value
Date Prod_Type Chainage Material_Id QTY_FTD Last_Updated
2013-02-13 1 192 2 120.00 2013-02-13 13:27:21.660
2013-02-13 1 247 2 560.00 2013-02-13 13:27:21.500
2013-02-13 1 192 2 400.00 2013-02-13 13:27:21.400
2013-02-12 1 192 2 150.00 2013-02-13 13:27:21.320
2013-02-14 1 192 2 200.00 2013-02-13 13:27:21.100
from the above table 192,247 are Chainage's , 2's are material_Id's, 1's are Production_Type's , 120.00 , 400.00 's are QTY_FTD 's


i want to calculate the QTY_Cumilative ie,i will pass Material_Id , Production_Type and i want to calculate the SUM(QTY_FTD) from the Last Last_Updated date for a particular Chainage

output required:
Prod_Type Chainage Material_Id QTY_Cumilative
1 192 2 1270
1 247 2 560
sk. maqdoom ali 13-Feb-13 2:14am View    
so nice, thanks a lot
sk. maqdoom ali 13-Feb-13 1:54am View    
the result must be like this
5 Project 1A 2 Project 1B NULL
6 PKG-1 3 Package 1 5
7 PKG-2 3 Package 2 5
13 Project 1B 2 Project 2B NULL
8 PKG-3 3 Package 3 13
9 PKG-4 3 Package 4 13