RetroCoder
RetroCoder

Reputation: 2685

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?

Upvotes: 6

Views: 4430

Answers (1)

Paul Creasey
Paul Creasey

Reputation: 28894

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)

Upvotes: 6

Related Questions