>SELECT userID, swipedate, MIN(SwipeTime) AS Time2 ;
> FROM temp WHERE VAL(swipetime) BETWEEN 1200 AND 1300 AND eventid='OUT' ;
> GROUP BY userID, swipedate ;
> INTO CURSOR c_LunchOut
>
>
>SELECT userID, swipedate, MAX(SwipeTime) AS Time2 ;
> FROM temp WHERE eventid='OUT' AND VAL(swipetime) < 1200;
> GROUP BY userID, swipedate ;
> INTO CURSOR c_AMUndertime
>
SELECT userID, swipedate, MIN(SwipeTime) AS Time2 ; FROM temp WHERE VAL(swipetime) BETWEEN 1200 AND 1300 AND eventid='OUT' ; GROUP BY userID, swipedate ; UNION ; SELECT userID, swipedate, MAX(SwipeTime) AS Time2 ; FROM temp WHERE eventid='OUT' AND VAL(swipetime) < 1200; GROUP BY userID, swipedate ; into cursor cAllPeopleWithLunchesAndWithout