Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update Table
Message
From
03/09/2004 17:45:53
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Update Table
Miscellaneous
Thread ID:
00939360
Message ID:
00939360
Views:
54
I have a table(currentbalance) that needs to be updated every month, the columns I need are Customer and balance, if customer didn't earn any balance I want to keep their current balance in tact but update any other customers balance that has changed. I've tried the "update" function but not working. Any direction appreciated.
SELECT a.customer, sum(a.redeem) as redeemed;
  FROM redeem a, date b;
  WHERE a.date between b.startdate AND b.enddate;
    group BY a.customer;
    into CURSOR redemption

SELECT customer, VAL(points) as Points;
  FROM ag;
  INTO cursor Pts

SELECT customer, sum(points) as Points;
  FROM pts;
  GROUP BY customer;
  INTO CURSOR CurtPts

SELECT a.customer, (b.balance-a.redeemed)+ c.points as Balance;
 FROM redemption a, currentbalance b, curtPts c;
 WHERE a.customer=b.customer AND c.customer=a.customer;
Next
Reply
Map
View

Click here to load this message in the networking platform