on 06-15-2011 7:56 AM
Experts,
select
T0.U_ItemCode,
T0.U_ItemName,
T0.U_Forecast,
SUM(T0.U_mrpqty)'Simulated Qty',
(select sum(onHand) from OITW T1 where T1.ItemCode = T0.U_itemcode) 'Current Quantity',
(select T3.ItmsGrpNam from OITM T2 inner join OITB T3
on T2.ItmsGrpCod = T3.ItmsGrpCod where T2.ItemCode = T0.U_itemcode)'Item group name'
from "@QUOTA1" T0
where T0.U_ItemCode = '[%0]'
and T0.U_Forecast = '[%0]'
group by
T0.U_itemcode,
T0.U_itemname,
T0.U_Forecast
When i run this query in Query Manager, it gives error
'User-Defined Values' (CSHS)
'Service Contracts' (OCTR)
What might be the issue?
HI rupa,
Add "dbo" in prefix to the table i.e [dbo].@Quota1
Hope this will solve your problem.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In fact I did this
select
T0.U_ItemCode,
T0.U_ItemName,
T0.U_Forecast,
SUM(T0.U_mrpqty)'Simulated Qty',
(select sum(onHand) from OITW T1 where T1.ItemCode = T0.U_itemcode) 'Current Quantity',
(select T3.ItmsGrpNam from OITM T2 inner join OITB T3
on T2.ItmsGrpCod = T3.ItmsGrpCod where T2.ItemCode = T0.U_itemcode)'Item group name'
from [dbo].[@QUOTA1] T0
where T0.U_ItemCode = '[%0]'
and T0.U_Forecast = '[%0]'
group by
T0.U_itemcode,
T0.U_itemname,
T0.U_Forecast
Thi time it i asking for Item Code only...! but Forecast is also a parameter.
HI
Check this query
select
T0.U_ItemCode,
T0.U_ItemName,
T0.U_Forecast,
SUM(T0.U_mrpqty)'Simulated Qty',
(select sum(onHand) from OITW T1 where T1.ItemCode = T0.U_itemcode) 'Current Quantity',
(select T3.ItmsGrpNam from OITM T2 inner join OITB T3
on T2.ItmsGrpCod = T3.ItmsGrpCod where T2.ItemCode = T0.U_itemcode)'Item group name'
from dbo.@QUOTA1 T0
where T0.U_ItemCode = '%1'
and T0.U_Forecast = '%0'
group by
T0.U_itemcode,
T0.U_itemname,
T0.U_Forecast
Edited by: kambadasan on Jun 15, 2011 12:57 PM
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.