0

I have a renewal date column and I would like my query to look at my renewal date on today's date and return a value (lets say reminder_sent) if their difference is 200 days. I want my query to exclude the weekends as well. Below what I roughly came up with. But I need help to get to my result. Could someone please help me with it.

dateiff(day,getdate(),convert(char(10),I.renew_date,101 )= 200 
AEM
  • 1,354
  • 8
  • 20
  • 30
  • Does this answer your question? [get DATEDIFF excluding weekends using sql server](https://stackoverflow.com/questions/7388420/get-datediff-excluding-weekends-using-sql-server) – Thom A Apr 30 '21 at 14:34
  • how can i set their difference to 200 days? – Mahdieh Reese Apr 30 '21 at 14:38
  • What do you mean by "set the difference"? Are you tehrefore asking how to *add* 200 working day to a date? – Thom A Apr 30 '21 at 14:40
  • yes! You are totally correct! how do minus 200 working days from my renewal date? I want to be able to start following up on my renewal 200 days before my renewal days come? this is the request: "We would like to create a process that will send an email to the managers on an account that is 200 days from the renewal date" – Mahdieh Reese Apr 30 '21 at 14:44
  • 1
    Does this answer your question? [Add business days to date in SQL without loops](https://stackoverflow.com/questions/7388420/get-datediff-excluding-weekends-using-sql-server) – Thom A Apr 30 '21 at 14:50
  • @MahdiehReese seems like you are not accepting answers in your previous question , please go back your previous questions and accept them as answer those which helped you. – eshirvana Apr 30 '21 at 16:08
  • yes! this answered my question, Thanks – Mahdieh Reese Apr 30 '21 at 17:44

0 Answers0