Quantcast
Channel: Classic ASP
Viewing all articles
Browse latest Browse all 488

need to find the end of the previous payroll

$
0
0

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>

Viewing all articles
Browse latest Browse all 488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>