Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select
Message
From
05/04/2010 16:28:24
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Select
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01458778
Message ID:
01458818
Views:
23
hi,

evrye values for filelds partofname is 2009 it is old values just i used to compare ,

but every month i fill(replace) the newtest form another table have 6 values via this code
SET DELETED ON
USE newtest 
UPDATE newtest  SET y2010 = T.val1  from newtest  inner join hamad T on newtest.ID = T.ID WHERE id1=2

UPDATE newtest SET PER1= (Y2010-Y2009)/Y2009 from newtest WHERE ID1=2
*brow

***********************************************************************
scan

SET FILTER TO  ID1=2 AND FLG=1
   SUM Y2010 TO M.D FOR id1=2
  
   
SET FILTER TO 
   REPLACE Y2010 WITH M.D FOR NAM="TOT1" AND id1=2
  
endscan

scan

SET FILTER TO  ID1=2 AND FLG=2
   SUM Y2010 TO M.D FOR id1=2
  
   
SET FILTER TO 
   REPLACE Y2010 WITH M.D FOR NAM="TOT2" AND id1=2
  endscan


scan

SET FILTER TO  ID1=2 AND FLG=3
   SUM Y2010 TO M.D FOR id1=2
  
   
SET FILTER TO 
   REPLACE Y2010 WITH M.D FOR NAM="TOT3" AND id1=2
 endscan
>The output above was not really helpful. Do you match records by name? In other words, for each month you have many records. How do you match each month?
>
>>>
>>>>Field  Field Name      Type                Width    Dec   Index   Collate Nulls    Next    Step
>>>>    1  ID1             Numeric                 3                             No
>>>>    2  ID              Numeric                 2                             No
>>>>    3  NAM             Character              10                             No
>>>>    4  Y2009           Numeric                15      3                      No
>>>>    5  Y2010           Numeric                15      3                      No
>>>>    6  PER1            Numeric                15      3                      No
>>>>    7  TY2009          Numeric                15      3                      No
>>>>    8  TY2010          Numeric                15      3                      No
>>>>    9  TPER            Numeric                15      3                      No
>>>>   10  FLG             Numeric                 2                             No
>>>>** Total **                                  108
>>>
>>>
>>>Ok, and also some data (copy to 'temp.txt' delimited with tab)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform