Conditional Data change in the Dataset

Hi,

I have one Table name Trn_ProjectAllocationToGang. It has following Columns:

1. Project Name

2. Employee Name

3. From Date

4. To Date

Condition:

Suppose I have entered a data in the table with following dataset:

"Project Name: Project A", "Employee Name: Test A", "From Date: 01/06/2022", "To Date:30/06/2022" and save in the database. it is Record 1 now in the table.

When I again insert new record with following dataset 

"Project Name: Project B", "Employee Name: Test A", "From Date: 25/06/2022", "To Date:30/06/2022" and save in the database. it is Record 2 now in the table.

Now when the record 2 is saved in the data base. it should go and check the previous records saved in the database. Find the maximum "To Date" record based on Project Name, Employee Name and based on the above example of 2 records. Record 1"To Date" should be changed to (Record 2 From Date - 1) 24/06/2022".

Would Appreciate a quick help on this.

Thanks, 

Rohit Gaur

0 1 34
1 REPLY 1

Steve
Platinum 4
Platinum 4
Top Labels in this Space