I have a SQL Server 2005 table called ‘Contracts’:
CREATE TABLE Contracts (
ContractNo int not null,
ExpirationDate smalldatetime not null,
NotificationInAdvancedDays int not null
)
I want to display only the contracts that are within the notification period (ExpirationDate+DaysNotificationInAdvanced) or contracts that are expired (ExpirationDate<CurrentDate).
You can achieve it like this: