Need help with the below query pleaseTable Name -Request_DetailDDL of Request_DetailCREATE TABLE [dbo].[Request_Detail]( [requestno] [numeric](18, 0) NOT NULL, [detid] [int] NOT NULL, [requireddt] [datetime] NULL, [finisheddt] [datetime] NULL, [eligibledt] [datetime] NULL, [notes] [varchar](1000) NULL
Sample Data for a Request in the Request_Detail Tablerequestno detid requireddt finisheddt eligibledt notes123456 1 2011-01-01 1900-01-01 1900-01-01 testing sample123456 2 1900-01-01 2011-01-01 1900-01-01 123456 3 1900-01-01 1900-01-01 2011-02-01 reporting need123456 4 1900-01-01 1900-01-01 2011-02-01 reporting need123456 5 1900-01-01 1900-01-01 2011-02-01 reporting need123456 6 1900-01-01 1900-01-01 2011-02-01 reporting need123456 7 1900-01-01 1900-01-01 2011-02-01 reporting needFrom the above table I need to insert into another table calledEvent_Log as in the below exampleRequestno updateddt comments123456 currentsystemdatetime item 1 saved as requireddt + notes123456 currentsystemdatetime item 2 saved as requireddt + notes123456 currentsystemdatetime item 3 saved as eligibleddt + notes123456 currentsystemdatetime item 4 saved as eligibleddt + notes123456 currentsystemdatetime item 5 saved as eligibleddt + notes123456 currentsystemdatetime item 6 saved as eligibleddt + notes123456 currentsystemdatetime item 7 saved as eligibleddt + NotesNote:The comments in the event log should be populated based on all the three dates in the request_detail table based on which date has date other than 1900-01-01