Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change these codes into sql
Message
From
11/11/2006 11:28:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01168938
Message ID:
01168939
Views:
14
>these code can be changes into sql
>
>Select accounts
> Locate For code=thisform.code.value
> opbl = opdr-opcr
> Select acctran
> Set Order To date
> Set Filter To
> Set Filter To code=thisform.code.value
> Goto Top
> Replace balance With 0 All
> Goto Top
> blnc = opbl
> Do While !Eof()
>     blnc = blnc+debit-credit
>     Replace balance With blnc
>     Skip
> Enddo
>
To change a value:
update AccTran;
  set Balance = 0;
  where Code = ThisForm.Code.Value
For the running total, it is more difficult. Personally, I prefer staying with the xBASE code.

Note that to process multiple records, it is better to use SCAN instead of DO WHILE. It saves you several commands.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform