SQLTeam.com | Weblogs | Forums

How to find % between two dates for the delay


#1

Hi Team,

I would like to find out the percentage for the delay only, I have the ScheduledDate and if do the activity on or before then i can say my
achievement is 100 % (Please refer row number 2,3, pop ringtones download but if i delay it (Please refer row number 1,4,5) then i have to find out delay in %. On or before i could find it using CASE statement because NoOfDays is 0 or less i can say its 100% (korean ringtones free)

ScheduledDate CompletedDate NoOfDays Month Year Percentage
2016-06-13 00:00:00.000 2016-06-14 00:00:00.000 1 JUNE 2016
2016-06-13 00:00:00.000 2016-06-13 00:00:00.000 0 JUNE 2016 100%
2016-06-02 00:00:00.000 2016-06-01 00:00:00.000 -1 JUNE 2016 100%
2016-06-08 00:00:00.000 2016-06-10 00:00:00.000 2 JUNE 2016
2016-06-17 00:00:00.000 2016-06-20 00:00:00.000 3 JUNE 2016

Please help me


#2

To calculate the percentage, don't you also need the information on what the period is? For example, if you were supposed to complete in 10 days, and you took 15 days, you could say the Percentage is 50.

Or is it something else that you are looking for? What would be the percentage for rows 1,4 and 5 if you were to calculate it by hand?