Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To: Group Data and club a field of the group using S
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00763525
Message ID:
00764640
Vues:
35
Thanks Sergey. This works like a charm w/ w/o ODBC
FUNCTION clubtestnames
	LPARAMETERS tiPID, tiType

	LOCAL lcStr, lcSelect, llsPatients, llmTests

	lcSelect = SELECT()
	lcStr    = ""


	IF !USED("sPatients")
		USE sPatients IN 0

		llsPatients = .T.
	ELSE
		llsPatients = .F.
	ENDIF


	IF !USED("mTests")
		USE mTests IN 0

		llmTests = .T.
	ELSE
		llmTests = .F.
	ENDIF


	SELECT sPatients
	SCAN FOR sPatients.iPID = tiPID
		SELECT mTests
		SCAN FOR mTests.iID = sPatients.iTest ;
			AND mTests.iType = tiType

			lcStr = lcStr + ALLTRIM(mTests.cTest) + " "

			SELECT mTests
		ENDSCAN

		SELECT sPatients
	ENDSCAN


	IF llmTests
		USE IN mTests
	ENDIF

	IF llsPatients
		USE IN sPatients
	ENDIF


	RETURN PADR(lcStr, 50)
ENDFUNC
>>Hi Sergey
>>
>>Thanks for your help, the following is the final creation from your suggestion and I have put it in the Stored Procedures for view to access it, but there is a problem leter on:
>
>I couldn't get it to work either but following version works.
LPARAMETERS lcLn
>LOCAL lcStr, lcOldArea
>lcOldArea = SELECT()
>lcStr  = ""
>IF NOT USED("test0")
>	USE test0 IN 0
>ENDIF
>SELECT test0
>SCAN FOR ln = lcLn
>	lcStr = lcStr + " " + sn
>ENDSCAN
>SELECT (lcOldArea )
>RETURN PADR(ALLTRIM(lcStr),32)
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform