Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the date of the first day of week given any date range of that week in vb6

How do I find the date of the first day of week given any date of current week in vb6 or classic asp?

like image 822
RetroCoder Avatar asked Mar 17 '11 23:03

RetroCoder


1 Answers

Weekday(date)

This returns an int between 1 and 7 for sun to sat. With this it is easy to get the date of the first day, but first you need to define the first day, assuming sunday then...

DateAdd("d", -Weekday(date)+1, date)

like image 125
Paul Creasey Avatar answered Nov 15 '22 12:11

Paul Creasey