Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE SQL, How to use with correlated query.
Message
From
06/05/2005 18:01:24
 
 
To
06/05/2005 17:33:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01011797
Message ID:
01011831
Views:
29
Thanks Cetin, and yes, it could be better, I was wondering if this is possible with a single query, I'll do the test to see what's the better approach. Thanks again!


>Esparta,
>I think dividing it would be better. Roughly:
Select iAgentId, Month(dDate) As Month, Year(dDate) As Year, Sum(yAmount) As YTot ;
    FROM cMovs ;
    GROUP By 1,2,3 ;
    into Cursor crsSums ;
    nofilter

Update cAgent ;
    SET yMonth = t2.YTot ;
    FROM crsSums t2 ;
    WHERE t2.iAgentId = cAgent.iid ;
    AND cAgent.nMonth = 1 And cAgent.nYear=2005 ;
    And t2.Month = cAgent.nMonth ;
    AND t2.Year = cAgent.nYear
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform