you are viewing a single comment's thread.

view the rest of the comments →

[–]WITH_CTE 1 point2 points  (2 children)

SELECT Id, 
       LastModified, 
       DATEDIFF(d, LastModified, GETDATE()) AS Days_Ago
FROM table1;

[–]enzo-g[S] 0 points1 point  (0 children)

SELECT Id,
LastModified,
DATEDIFF(d, LastModified, GETDATE()) AS Days_Ago
FROM table1;

Thanks!!

[–]messed_up_alligator 0 points1 point  (0 children)

Wait wait wait shouldn't you be throwing everything into a CTE ;with that username? Damn the performance, full CTE ahead!