Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Givng a new name to multiple Cursors for each month
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Givng a new name to multiple Cursors for each month
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01512741
Message ID:
01512741
Vues:
115
I would like to give a new name to each of the 12 months of data cursors that I will produce in the below SQL statements, but the below isn't working. How do you give a variable name to the cursor name?
FOR nMonth = 1 TO 12
	lcMonth = GetAlphaMonth(nMonth)
	ldDate = CTOD(PADL(nMonth,2,"0")+"/01/2010")
	ldBegDateOfMonth=ldDate - DAY(ldDate) + 1
	ldEndDateOfMonth=GOMONTH(ldDate - DAY(ldDate) + 1,1) - 1
	
	SELECT lcMonth+" 2010" AS Month_Year, ;
			GrpID, Emp_ID, ;
			SUM(bill_prem) AS Month_Billed, ;
			BnftName, ;
			0000000.00 AS Month_Collected ;
		FROM tmp1 ;
		WHERE BETWEEN(bill_date, ldBegDateOfMonth, ldEndDateOfMonth);
		INTO CURSOR '+"tmp" +str(nMonth)+' ;
		GROUP BY GrpID, Emp_ID, BnftName
	
ENDFOR
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform