Link to home
Start Free TrialLog in
Avatar of Member_2_6478753
Member_2_6478753Flag for United States of America

asked on

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

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
Avatar of Yagya Shree
Yagya Shree
Flag of India image

Please use below query

Select getdate+2
Select enddate-2
Avatar of Kyle Abrahams, PMP
select * from subscriptions
where datediff(d, getdate(), subscription_date) > 2
Avatar of Member_2_6478753


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
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial