• Thanks so much for helping out. I will use the syntax posted in the solution.

    Here is the part that I had needed help with in my where clause...

    (where (timesheet.wcstart between @start_date and @end_date and timesheet.wcfinish is null))

    INSERT INTO #timesheet

    SELECT emp.firstname + ' ' + emp.surname, mo.monumber, inv.customer_part_num, inv.description, t.opno, routing.description,workcenter.name,

    Case When timesheet.wcstart < @start_date then @start_date

    Else timesheet.wcstart

    End,

    timesheet.wcfinish,

    ISNULL(workcenter.machine,'X'),

    '',

    TSNo

    FROM mfg_timesheet t

    Left outer join cubs..mfg_mo_routing routing On

    routing.companyid = timesheet.companyid and

    routing.mo_key = timesheet.mo_key and

    routing.opno = timesheet.opno

    Left outer join cubs..mfg_workcenter workcenter On

    workcenter.wcno = timesheet.wcno and

    workcenter.companyid = timesheet.companyid,

    mfg_mo mo, inv_item inv,mfg_employee emp,slsord sls

    where (timesheet.wcstart between @start_date and @end_date and timesheet.wcfinish is null) and

    mo.mo_key = timesheet.mo_key and

    emp.employeeid = timesheet.employeeid and

    mo.companyid = inv.company_id and

    mo.stocknumber = inv.stock_number and

    timesheet.companyid = 1 and

    workcenter.machine IN ('W') And

    TSNo NOT IN (SELECT TsNo FROM mfg_timesheetAdj) and

    sls.company_id = mo.companyid and

    sls.slsord_number = mo.slsord_number