0

Week ends on Sunday. So today, Friday, has week ending date DateTime.Today.AddDays(2), correct?

And in general, if I calculate the number of days from the given date until the week ending date and assign it to DaysToWeekEnding (number value), then

DateTime.Today.AddDays(DaysToWeekEnding) , right?

Well I keep getting an error when trying to set the default value of a date field to the above. "No applicable method 'adddays' exists in type 'DateTime'. But if I replace DaysToWeekEnding with a literal number (e.g. 2), then the form builder accepts it as valid.

Please help me out of this loop, or let me know of another way to obtain a week ending date.

1

I think you specifically need to convert that number (DaysToWeekEnding) into an integer. So your calculation should look like this:

=DateTime.Today.AddDays(Int32.Parse(DaysToWeekEnding))

I hope this helps to get you out of that loop.

  • That did it, Jennifer. Thank you! – Steve Oliveau Sep 16 '16 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.