{$page}

This query provides the basic information for employees detail timecards. This does not include the overall clock in and clock out, but only the time cards that are created for production purposes.

None. This is a selection query and no data is modified in the running of it.

code_formatsql

declare @startdate datetime;

declare @enddate datetime;

– uncomment this for SQL, comment this out for Cyrious SQL Reports

– set @startdate = '4/1/2010';

– set @enddate = '4/30/2010 11:59';

– comment this out for SQL, uncomment this for Cyrious SQL Reports

set @startdate = ;

set @enddate = ;

select

  (Select LastName +', '+FirstName from Employee where ID = EmployeeID) as EmployeeName,
  (Select OrderNumber from TransHeader where ID = Journal.TransactionID) as OrderNumber,
  (Select StationName from Station where ID = Journal.StationID) as Station,
  StartDateTime, Journal.EndDateTime, Description,
  (StraightTime + OverTime + DoubleTime + ShiftDiffTime) as HoursOn,
  (case when ManuallyAdjusted = 1 then 'Yes' else 'No' end) as Adjusted,
  Journal.ModifiedDate as EntryDate,
  Journal.EmployeeID,
  Journal.StationID,
  Journal.TransactionID as TransHeaderID,
  TransDetailID

from Journal

join TimeCard on Journal.ID = TimeCard.ID

where startdatetime < > enddatetime and Journal.ClassTypeID = 20051

and (StartDateTime between @startdate and @enddate 
     or EndDateTime between @startdate and @enddate)

order by EmployeeName, StartDateTime desc

code

  • Entered : 08/2010
  • Version : Control 4.3+
You could leave a comment if you were logged in.