Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert codes in sql
Message
From
03/05/2005 14:01:13
 
 
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:
01010560
Views:
23
Replace your code with code below and replace expression in ORDER BY clause with your expression.
m.monthfm = THISFORM.monthfm.VALUE
m.montht0 = THISFORM.monthto.VALUE
m.adate = THISFORM.adate.VALUE
SELECT a.CODE, SUM(a.debit) AS dr, SUM(a.credit) AS cr FROM acctran a ;
	WHERE DATE<= m.adate AND acctan.MONTH BETWEEN m.monthfm AND m.monthto ;
	GROUP BY a.CODE ;
	INTO CURSOR TempCursor
UPDATE student SET ;
    dr = opdr + TempCursor.dr, ;
    cr = opcr + TempCursor.cr ;
    FROM TempCursor ;
  WHERE student.CODE = TempCursor.CODE

SELECT * FROM student WHERE CODE>=THISFORM.codefm.VALUE AND CODE<=THISFORM.codeto.VALUE AND ;
	SEC>=THISFORM.secfm.VALUE AND SEC<=THISFORM.secto.VALUE AND scode>=THISFORM.shiftfm.VALUE AND ;
	scode<=THISFORM.shiftto.VALUE AND lcode>=THISFORM.levelfm.VALUE AND lcode<=THISFORM.levelto.VALUE AND ;
	admtd=1 AND IIF(THISFORM.cfname.VALUE=1, fname=THISFORM.fname.VALUE, !(dr-cr=0)) ;
	ORDER BY expression_in_LCODE_index_TAG ;
	INTO CURSOR TmpCursor

IF _TALLY > 0
	REPORT FORM (ALLTRIM(THISFORM.FILE.VALUE)) PREVIEW
	USE IN TmpCursor
	SELECT student
	DO FILTER
ELSE
	= MESSAGEBOX('Data not found for Selected Criteria', 32, PRODUCT)
	RETURN .T.
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform