tsql check if datediff is 2 days only btween enddate and getdate

AFIF JABADO
AFIF JABADO used Ask the Experts™
on
i want to use the function datediff to match all record whe have difference btween the enddate end current date is 2

for example each record has a expirydate i want to gets all records where the subscription end after 2 days
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Please use below query

Select getdate+2
Select enddate-2
Kyle AbrahamsSenior .Net Developer

Commented:
select * from subscriptions
where datediff(d, getdate(), subscription_date) > 2

Author

Commented:
i want only get if is equal to 2 !! for automatic renew the subscription
if the expiration end after 2 days i will send to the user a notification not > 2
Senior .Net Developer
Commented:
select * from subscriptions
where datediff(d, getdate(), expiry_date) = 2

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial