Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To: Group Data and club a field of the group using S
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00763525
Message ID:
00764640
Views:
36
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
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform