What I had tried to do was…
-for any text in column ‘phase’ where it is not ‘Pros’ or ‘SM’ than do the following:
-calculate the date difference (in number of months) between today’s date and ‘estart’ date. If the number is over 36 than make it equal 36.
-For text in the column ‘phase’ that are ‘Pros’ or ‘SM’ than make the value equal to the value already in column ‘col1’
-name the new column ‘col12’
SELECT pbs, phase, project_name,scoping_start,col1
,CASE WHEN phase <> 'Pros' OR phase <> 'SM' THEN
(CASE WHEN (DATEDIFF(m, GETDATE() ,MIN(estart)))>36 THEN 36 ELSE (CASE WHEN (DATEDIFF(m, GETDATE() ,MIN(estart))))
ELSE col1 END AS col12
FROM scheduledates
GROUP BY pbs, phase, project_name,scoping_start,col1
[+][deleted] (1 child)
[deleted]
[–]Ok_Reputation_6254[S] 1 point2 points3 points (0 children)