Query

  • 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?

  • 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

  • I need

    List of first intime and last out time entries everday for the chosen month for a particular employee

  • 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

  • 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

  • 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