Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert codes in sql
Message
De
03/05/2005 14:01:13
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01010484
Message ID:
01010560
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform