Question : SQL - Date calulation from current date

I need to calculate when a video is overdue.  I have the query setup to show which videos have a null field in the In_Date column.    What is missing is calculating the Out_Date and the current date to show a video checked out more than 10 days.  I have included the pseudo code at the end of the query. Any help is appreciated.

Thanks
Code Snippet:
1:
2:
3:
4:
5:
SELECT     Employees.First_Name, Employees.Last_Name, VideoList.Video_Name, Detail.In_Date, Detail.Out_Date
FROM         Employees INNER JOIN
                      Detail ON Employees.EmployeeID = Detail.EmployeeID INNER JOIN
                      VideoList ON Detail.VideoID = VideoList.VideoID
WHERE     (Detail.In_Date IS NULL) and Out_date is more than 10 days from Now()

Answer : SQL - Date calulation from current date

JohnMac328,

I see.  In the DATEDIFF expression, try putting Out_Date in the second position, and GETDATE() in the 3rd.  I
think I misunderstood the requirement.

DATEDIFF(day, Out_Date, GETDATE()) > 10

Patrick
Random Solutions  
 
programming4us programming4us