SQL Max() and Min() Functions Help need...
Table
USERID NAME Date Time
1 D.A.U.Nishantha 24/8/04 8:20:00 AM
2 D.A.U.Nishantha 24/8/04 5:51:00 PM
3 M.J.Dharmakeerthi 24/8/04 8:14:00 AM
5 M.J.Dharmakeerthi 24/8/04 9:03:00 PM
7 M.S.Asanka 24/8/04 7:59:00 AM
7 M.S.Asanka 24/8/04 5:01:00 PM
8 W.S.Francis 24/8/04 8:20:00 AM
9 W.S.Francis 24/8/04 8:14:00 PM
Query
SELECT USERINFO.USERID, USERINFO.NAME, CVDate(DatePart('d',[CHECKTIME]) & '/' & DatePart('m',[CHECKTIME]) & '/' & DatePart('yyyy',[CHECKTIME])) AS [Date], TimeValue([CHECKTIME]) AS [Time]
FROM CHECKINOUT INNER JOIN USERINFO ON CHECKINOUT.USERID = USERINFO.USERID
WHERE (((CVDate(DatePart('d',[CHECKTIME]) & '/' & DatePart('m',[CHECKTIME]) & '/' & DatePart('yyyy',[CHECKTIME])))=Date()));
in this above table each employee has 2 records.i need to display records with maximum time in a seperate query and minimum time values in seperate query. how can i use Max ans Min functions in this above query...please help me....
Regards
shana
|