Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL-View
Message
From
20/10/1998 16:08:29
Senna Dwipayana
Indo Rebel Apparel Cv
Bandung, Indonesia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL-View
Miscellaneous
Thread ID:
00148630
Message ID:
00148630
Views:
56
I'm trying to create a view progamatically, but it run so slow, the 1st table (quoteprx.dbf) only have 700 record and 2nd (Order.dbf) got 68 record in it, can someone check what wrong in my code ?

CREATE SQL VIEW quote_editor AS ;
SELECT DISTINCT QuotePrx.prxdate,QuotePrx.goods,;
ALLT(TRANSFORM(QuotePrx.prx,'9,999,999.99'))+'/'+ALLT(QuotePrx.Unit);
+'='+ALLT(TRANSFORM(QuotePrx.content,'999,999,999'))+' '+;
ALLT(QuotePrx.ucontent) AS cPrx,;
ALLT(TRANSFORM(QuotePrx.con,'999,999.99'));
+' '+ALLT(QuotePrx.unit_con)+'/'+;
IIF(QuotePrx.con_per=1,SPACE(0),;
ALLT(TRANSFORM(QuotePrx.con_per,'999,999')))+' '+ALLT(Order.Cat) AS cCon_per,;
PAYMENT;
(QuotePrx.con/QuotePrx.content/QuotePrx.con_per,QuotePrx.tol/100,1) AS conperpcs,;
IIF(QuotePrx.Ratio<1,;
PAYMENT;
(QuotePrx.con/QuotePrx.content/QuotePrx.con_per,QuotePrx.tol/100,1);
*(QuotePrx.Ratio*Order.Qty),;
CEILING;
(PAYMENT;
(QuotePrx.con/QuotePrx.content/QuotePrx.con_per,QuotePrx.tol/100,1)*;
(QuotePrx.Ratio*Order.Qty))) AS totalcon, ;
PAYMENT;
(QuotePrx.con/QuotePrx.content/QuotePrx.con_per,QuotePrx.tol/100,1);
*QuotePrx.prx AS amoperpcs,;
IIF(QuotePrx.Ratio<1,PAYMENT;
(QuotePrx.con/QuotePrx.content/QuotePrx.con_per,QuotePrx.tol/100,1)*;
(QuotePrx.Ratio*Order.Qty),CEILING(PAYMENT;
(QuotePrx.con/QuotePrx.content/QuotePrx.con_per,QuotePrx.tol/100,1)*;
(QuotePrx.Ratio*Order.Qty)))*QuotePrx.prx AS totalamo, ;
QuotePrx.prx,QuotePrx.con_per,QuotePrx.con,QuotePrx.orderno,;
QuotePrx.unit_con,QuotePrx.tol,QuotePrx.ccode,QuotePrx.ccolor,;
QuotePrx.cunit,QuotePrx.ratio,;
QuotePrx.part,QuotePrx.dataid,QuotePrx.color, QuotePrx.unit,;
QuotePrx.content, QuotePrx.ucontent, ;
Order.vcode, Order.art, Order.style, Order.desc,;
Order.qty, Order.sale, Order.cat AS order_cat, Order.dated,;
QuotePrx.Ratio*Order.Qty AS QtyPerColor ;
FROM main!QuotePrx, main!order;
WHERE ;
UPPER(ALLTRIM(QuotePrx.orderno))==UPPER(ALLTRIM(Order.orderno)) = .T.;
AND !DELETED()=.T.

TIA :)
Senna Dwipayana
Being good is better
Being better is a bless
Next
Reply
Map
View

Click here to load this message in the networking platform