Here's the view:
create sql view lv_OrdDet as ;
select OD.kOrder, OD.iQty, OD.nPrice, OD.lCresting, OD.lCrest_ch, OD.nCrest_Prc ,;
OD.nCrest_Sty, OD.kPeople, G.cMaterial, G.nDefPrice, G.nCst_Mat, OD.kOrderDet,;
P.cName, O.kLoc, PLC.cDescrip as Color, PLC.cAbrev, G.cStyle, G.cDescrip ,;
iif(OD.lCresting,iif(OD.nCrest_Sty = 1,"Oval","Emb.")," ") as cCrest_Sty ,;
iif(OD.lChg4Add, OD.nCrest_Prc, 0.00) as nCrest_Chg ,;
(OD.nPrice + iif(OD.lChg4Add, OD.nCrest_Prc, 0.00)) * OD.iQty as nTotPrice ,;
trim(PLS.cDescrip)+iif(G.cStyle="P","x"+trim(PLL.cDescrip),"") as cSize ;
from OrderDet OD ;
right join Orders O ;
on OD.kOrder = O.kOrder ;
left join People P ;
on OD.kPeople = P.kPeople ;
left join PickList PLC ;
on PLC.kPickList = OD.kColor ;
left join PickList PLS ;
on PLS.kPickList = OD.kSize ;
left join PickList PLL ;
on PLL.kPickList = OD.kLength ;
left join Garments G ;
on G.kGarment = OD.kGarment ;
where O.kOrder = gkOrder ;
order by G.cStyle, P.cName
It doesn't reference anything with a variable length index.
It failes after being run with nCrest_Chg calculated as a zero value, and then requeried with a non-zero calculated value for nCrest_Chg. It's on this that I have been focusing, but now am looking for something more general as I've hit a dead end.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only