How to convert this sql statement to storeproc? -
select "Dly_DC_LostSlsSnpsht_v"."PlntCd" "Plnt_Id_Cd" , "Dly_DC_LostSlsSnpsht_v"."DivCd" "Div_Cd" ,
-
"GlblCatSum"."GlblCatSumCd" "Gbl_Cat_Sum_Cd" , (coalesce("GlblCatSum"."GlblCatSumDesc",
-
'Unknow')) "Gbl_Cat_Sum_Desc" , "Dly_DC_LostSlsSnpsht_v"."ProdtCd" "Prod_Cd" ,
-
"ProdtGPI"."ProdtLglLongNm" "Matl_Nm" , "Dly_DC_LostSlsSnpsht_v"."WhlslPrcAmt_USD" "Whlsl_Prc__USD_" ,
-
sum("Dly_DC_LostSlsSnpsht_v"."EstdLostSlsQty") "Estd_Lost_Sales_Qty" ,
-
sum("Dly_DC_LostSlsSnpsht_v"."EstdLostSlsAmt") "Estd_Lost_Sales_Amt" ,
-
sum("Dly_DC_LostSlsSnpsht_v"."EstdDmndQty") "Tot_AO_Dmd_Qty" ,
-
(sum("Dly_DC_LostSlsSnpsht_v"."EstdLostSlsQty") * 1.0e0) / (NULLIF(sum("Dly_DC_LostSlsSnpsht_v"."EstdDmndQty"),
-
0)) "Estd_Lost_Sales__"
-
from "EIS"."Dly_DC_LostSlsSnpsht_v" "Dly_DC_LostSlsSnpsht_v",
-
"EIS"."GlblCatSum" "GlblCatSum", "EIS"."ProdtGPI" "ProdtGPI",
-
"EIS"."GlblCatCoreFcs" "GlblCatCoreFcs"
-
where "Dly_DC_LostSlsSnpsht_v"."CalRunDt" between date - 1
-
and date
-
and "Dly_DC_LostSlsSnpsht_v"."ProdtCd" = "ProdtGPI"."ProdtCd"
-
and "GlblCatCoreFcs"."GlblCatCoreFcsCd" = "ProdtGPI"."GlblCatCoreFcsCd"
-
and "GlblCatSum"."GlblCatSumCd" = "GlblCatCoreFcs"."GlblCatSumCd"
-
group by "Dly_DC_LostSlsSnpsht_v"."PlntCd", "Dly_DC_LostSlsSnpsht_v"."DivCd", "GlblCatSum"."GlblCatSumCd", (coalesce("GlblCatSum"."GlblCatSumDesc", 'Unknow')), "Dly_DC_LostSlsSnpsht_v"."ProdtCd", "ProdtGPI"."ProdtLglLongNm", "Dly_DC_LostSlsSnpsht_v"."WhlslPrcAmt_USD"
1 1260 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Lauren Quantrell |
last post by:
I have a stored procedure using Convert where the exact same Convert
string works in the SELECT portion of the procedure but fails in the
WHERE portion.
The entire SP is listed below....
|
by: Service Tech |
last post by:
I have a variable that I am passing to a stored procedure from a
propritery software application. The variable it passes is the number
of days that have passed since 1/1/1900. I cannot seem to...
|
by: Rachel Weeden |
last post by:
I'm working on an ASP Web application, and am having syntax issues in
a WHERE statement I'm trying to write that uses the CInt Function on a
field.
Basically, I want to select records using...
|
by: jguilford |
last post by:
I have created a SQL Stored Procedure that uses a Case statement to
determine the Order By. For one of the Case statements I am trying to
turn a Char field into Datetime in for the Order By,...
|
by: Twobridge |
last post by:
I hope someone can help me out with my problem.
I have found a sql statement that basically pulls all bills filed
within a
certain time period and the payments made on those bills with in the...
| |
by: sp |
last post by:
I have this strange problem. The application I am working on imports
color values from Flash that look like this:
0x-f9fff6
And, on the script side, it uses a conversion algorithm to
convert...
|
by: lyle777 |
last post by:
I am having trouble with the nested if statement.
can anyone tell me where i went wrong with this code?
the syntax error starts by the else statement within the target of the
first if statement....
|
by: vasanth chandrasekaran |
last post by:
The error is :Syntax error in INSERT INTO statement.
This is my code:
try
{
DataSet ds1;
OleDbConnection ConnSql;
OleDbConnection...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |