Discussion:
Automatic Entry of Start Date and End Date
(too old to reply)
rpboll
2015-11-07 08:35:17 UTC
Permalink
Hello! I am trying to design a new form that automatically enters a start date and an end date based on the current date.

Here's the form criteria:

The day range for the period is from Thursday through Wednesday

So regardless of what the current day is within that range when queried, the start date should be the previous Thursday of the week based on todays date, and the end date should be the next Wednesday based on todays date (or 7 days after the start date).

So if todays date is Friday, November 6, 2015, the automatic entry dates should be a start date of last Thursday, November 5, and an end date of Wednesday, November 11, 2015.

I'd appreciate any help with this!

Thanks in advance!

RBollin
Ulrich Möller
2015-11-26 16:44:12 UTC
Permalink
Post by rpboll
Hello! I am trying to design a new form that automatically enters a start date and an end date based on the current date.
The day range for the period is from Thursday through Wednesday
So regardless of what the current day is within that range when queried, the start date should be the previous Thursday of the week based on todays date, and the end date should be the next Wednesday based on todays date (or 7 days after the start date).
So if todays date is Friday, November 6, 2015, the automatic entry dates should be a start date of last Thursday, November 5, and an end date of Wednesday, November 11, 2015.
I'd appreciate any help with this!
Thanks in advance!
RBollin
See https://msdn.microsoft.com/EN-US/library/hh134613(v=office.14).aspx
<https://msdn.microsoft.com/EN-US/library/hh134613%28v=office.14%29.aspx>.
The interesting functions are FirstDayInWeek and LastDayinWeek. With
slightly modifications to your needs you can use it for your query.

Ulrich

Loading...