I need to find the previous enddate of our payroll in classic asp. I have the following code that sort of works. This is what I am looking for:
Date Range Date I am looking for
1-18-2020 to 1-31-2020 1-17-2020
1-4-2020 to 1-17-2020 1-3-2020
12-21-2020 to 1-3-2020 12-20-20
What am I doing wrong?
<div class="highlight">Const startdate = "7/3/2010" tempdate = "1/25/2020" diff = datediff("w",startdate,tempdate) daystoend = (diff mod 14) - 7 nextstartdate = (dateadd("d",daystoend,date)) previousenddate = dateadd("d",-14,nextstartdate) response.write previousenddate</div>