Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert codes in sql
Message
From
03/05/2005 12:55:15
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01010484
Message ID:
01010530
Views:
23
>thanks Sylvain your helpful reply,
>pls explaine me more with codes
>
>Select 6
> Goto Top
> Do While !Eof()
>     tcode = code
>     Select 7
>     Set Order To refno
>     Set Filter To code=tcode and date<=thisform.adate.value AND month=>thisform.monthfm.value and month=<thisform.monthto.value
>     Sum debit To mdr
>     Sum credit To mcr
>     Select 6
>     Replace dr With dr+mdr
>     Replace cr With cr+mcr
>     Skip
> Enddo
>
Try this:
SELECT select6_name
tcode = CODE
m.monthfm = THISFORM.monthfm.VALUE
m.montht0 = THISFORM.monthto.VALUE
m.adate = THISFORM.adate.VALUE
SELECT SUM(debit), SUM(credit) FROM select7_name  ;
	WHERE CODE=tcode AND DATE<= m.adate AND select7_name.MONTH BETWEEN m.monthfm AND m.monthto ;
	INTO ARRAY arTempArray
UPDATE select6_name ;
	SET dr = dr+ arTempArray[1], ;
	    cr = cr+ arTempArray[2] ;
	WHERE select6_name.CODE = tcode
RELEASE arTempArray
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform