General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Adding LEFT function to a UDF function within SELECT
I have a UDF called SECTIONS.
SELECT SECTIONS(st300.uid,'2000','FALL') FROM st300
gives me blanks, but
SELECT LEFT(SECTIONS(st300.uid,'2000,'FALL'),32) FROM st300
gives me the correct result (string).
Anybody knows why?
Here's the function:
FUNCTION SECTIONS(pUID,pYear,pSem)
LOCAL xRet, xTemp, xSS440
xRet=''
xSS440=zSS+'SS440' &&zSS is a global variable for path to SS files.
DO CASE
CASE UPPER(pSem)="FALL"
xSem='1'
CASE UPPER(pSem)="SPRING"
xSem='2'
CASE UPPER(pSem)="SUMMER"
xSem='0'
ENDCASE
*sts='S' means scheduled.
*List only scheduled sections.
SELECT sts,sec FROM &xSS440 ;
WHERE UID=pUID and sem=xSem and year=pYear and sts='S' ;
ORDER BY UID,per INTO CURSOR xTemp
GO TOP
DO WHILE NOT EOF()
IF EMPTY(xRet) THEN
xRet=str(sec,3)
ELSE
xRet=xret+','+str(sec,3)
ENDIF
SKIP
ENDDO
Return xRet
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only