Hello, I am dealing with SQL server 2005 and i have data from a system where i am tracking an application at each stage in the system. i have data in a tabular form as follows and the dates are derived from an sql statement. how best can i write a select statement to calculate the duration at each stage of the application.
Name |Telephone|ApplicationDate|InitialSurvey|ApprovalA|ApprovalB|ApprovalC|ApprovalD|ApprovalE
FRED |772507857|8/6/2013 |8/9/2013 |8/9/2013 |8/21/2013|8/29/2013|9/5/2013 |8/21/2013
ALI |712956901|8/10/2013 |8/12/2013 |8/12/2013|8/21/2013|8/30/2013|9/5/2013 |8/21/2013
I would therefroe like to display in the last 6 columns the duration for instance under initial survey, i would have 0 which is initial survey date minus application date then the next column would be Approval A date minus initial survey date.
* Please note that the last 6 columns are logs in one table which i am retrieving using cases
I will appreciate any assistance accorded to me. Thank you.
Swit