I need to create a custom order by. Can icase() be used in an order by clause? If so, what am I missing here? For the life of me, I can't figure it out. I get an error when trying to save the code: Function name is missing ). Any help would be greatly appreciated.
SELECT * FROM RosterReport ORDER BY fldTitle DESC, ICASE(fldYearInSchoolID = 4 AND fldIsPledgeFlag = 0, 4 ;
fldYearInSchoolID = 3 AND fldIsPledgeFlag = 0, 3 ;
fldYearInSchoolID = 2 AND fldIsPledgeFlag = 0, 2, 1) DESC, fldLastName, fldFirstName
I am using VFP 9 SP2.
SELECT * FROM RosterReport ORDER BY fldTitle DESC, ICASE(fldYearInSchoolID = 4 AND fldIsPledgeFlag = 0, 4 ;
fldYearInSchoolID = 3 AND fldIsPledgeFlag = 0, 3 ;
fldYearInSchoolID = 2 AND fldIsPledgeFlag = 0, 2, 1) DESC, fldLastName, fldFirstName
I am using VFP 9 SP2.