i want to update new field in 'ActualDate' field in 'tbl_Task' table . fetch data from 'tbl_TaskHistory' 'CreatedDate' field .Task ID is commen in two table. Same task id exist multiple times in task history. i want to fetch first data from task History table based on created date asc.
Loading
Tahir AnsariPosted Aug 1, 2023, 10:45 AM
Cr BhargaviPosted Aug 5, 2023, 12:21 PM
Manikandan MurugesanPosted Aug 1, 2023, 5:25 PM
To fetch the earliest record from the
tbl_TaskHistorytable based on theCreatedDatefor eachTaskIDand update the correspondingActualDatein thetbl_Tasktable, you can use a SQL query with theROW_NUMBER()function to rank the records byCreatedDatein ascending order and then perform an update.Amit MohantyPosted Aug 1, 2023, 8:23 AM
TarunPosted Aug 1, 2023, 7:59 AM
to restrict multiple ids use pk and use first() function