March 20, 2006 at 11:09 pm
I need a late entry report query
constraints are
For a Particular employee
For a given month
For in time and out time every day i.e. Minimum & Maximum time of entry
Fields are
ETY_EMPNO - Employee Number
ETY_EVENTDATE - Date of Entry
ETY_INTIME - In Date & Time
ETY_OUTTIME -Out Date & Time
could anyone sort out this problem for me?
March 20, 2006 at 11:16 pm
I dont understand you requirement completely, but i think following will work for you.
SELECT *
FROM YourTable
WHERE ETY_EMPNO = @EmpNo
AND DatePart(MM, ETY_EVENTDATE) = @Month
AND ETY_INTIME >= @InTime
AND ETY_OUTTIME <= @OutTime
March 20, 2006 at 11:31 pm
I need
List of first intime and last out time entries everday for the chosen month for a particular employee
March 20, 2006 at 11:47 pm
SELECT ETY_EMPNO, MIN(ETY_INTIME), MAX(ETY_OUTTIME)
FROM YourTable
WHERE ETY_EMPNO = @EmpNo
AND DatePart(MM, ETY_EVENTDATE) = @Month
GROUP BY ETY_EVENTDATE
March 20, 2006 at 11:49 pm
Sorry ignore the previous one....
SELECT ETY_EMPNO, ETY_EVENTDATE, MIN(ETY_INTIME), MAX (ETY_OUTTIME)
FROM YourTable
WHERE ETY_EMPNO = @EmpNo
AND DatePart(MM, ETY_EVENTDATE) = @Month
GROUP BY ETY_EMPNO, ETY_EVENTDATE
March 21, 2006 at 2:17 am
Thanks
i got the output
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply