question

Emad avatar image
Emad asked

Calculating Start and End Dates From Predecessors in SQL

SQL I have the following data in which I have duration and predecessors for my activities. Now I want to calculate the start and end date of activities with reference to their predecessors. The data is sampled below. Also please note there might be activities which may not have predecessors so their start date should be @startDate and end date should be calculated from their duration and sundays should be excluded.

Sample Data

https://i.imgur.com/JWTEO59.png

Required Data

https://i.imgur.com/6mbtTzo.png

Please provide me the solution asap.

Thanks.

sql-server-2012
untitled.png (7.0 KiB)
untitled2.png (8.5 KiB)
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Emad avatar image Emad commented ·

There is a mistake on Activity # 1, it will not have any predecessor. So please don't take 2 predecessor for Building contract.

0 Likes 0 ·
Jon Crawford avatar image Jon Crawford commented ·

what have you tried, and what is not working about what you have tried?

If you have not tried anything and would just like a solution, simply enclose your salary for today in an unmarked envelope, small bills only.

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.