SELECT CASE WHEN CHANGEDBY=” THEN CREATEDAT ELSE CHANGEDAT END AS CREATEDAT , CASE WHEN CHANGEDBY=” THEN
DATEDIFF(DAY,CREATEDAT,GETDATE())
ELSE
DATEDIFF(DAY,CHANGEDAT,GETDATE())
END AS TLINE FROM PNTFBOMASSREV;
SELECT CASE WHEN CHANGEDBY=” THEN CREATEDAT ELSE CHANGEDAT END AS CREATEDAT , CASE WHEN CHANGEDBY=” THEN
DATEDIFF(DAY,CREATEDAT,GETDATE())
ELSE
DATEDIFF(DAY,CHANGEDAT,GETDATE())
END AS TLINE FROM PNTFBOMASSREV;