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 Answer 1

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.

1
  • That did it, Jennifer. Thank you! Sep 16, 2016 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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