• Phil Parkin (7/29/2014)


    Koen Verbeeck (7/29/2014)


    INSERT INTO db1.dbo.attendance_details(employee_no,date_of_attendance,present,shift_type,marked_by)

    SELECT employee_no,date_of_attendance,present,shift_type,marked_by

    FROM db2.dbo.attendance_details

    WHERE date_of_attendance IN ('2014-07-01','2014-07-02');

    Might need to tweak your filter a bit:

    --

    WHERE date_of_attendance >= '2014-07-01' and date_of_attendance < '2014-07-03'

    Ah yes, the data type is datetime and not date. Nicely spotted.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP