Infopath current month validation

Thompson, Nicoli 96 Reputation points
2021-09-02T22:29:08.607+00:00

I am looking to write a validation rule in InfoPath such that the date of a date field must be in the same month as the current date. I can write it using a Month() code in excel and SharePoint, but not in InfoPath. Am I missing something? Is there a way to accomplish it?

SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
586 questions
0 comments No comments
{count} votes

Accepted answer
  1. Thompson, Nicoli 96 Reputation points
    2021-09-03T01:51:28.057+00:00

    Found the answer. You have to create a field and use the following formula as the default value:

    Substring(datefield,6,2) to get the month from a date field.

    Then create another field and use the following formula as the default value:

    Substring(Today(),6,2)

    Then, on the date field, add a validation rule stating field A must not be equal to field B.

    This will set the date field to accept only dates from the current month as today.

    Go me!


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.