DATE/TIME variable defaulted to 1st and last day of the month

Could you be kind and assist me in the following

  • Would like to create a Date/Time variable called Survey_Date but consisting only of Year and Month; note that it must not be a String. Just Date Format excluding Day;
  • How can I create a DATE VARIABLE defaulting system date to 1st of every month and another one defaulting to last day of the month

Hi phany,
I don’t know if it will be helpful but check this link:

Check under the heading CenturyMonthCode.

1 Like

This request belongs to Feature Suggestion.
Currently, there is no direct way to implement what you are asking. However, #2 is on our short list of features that will be implemented in the next 2 - 3 releases.
As a workaround for #1 I might suggest a combination of a numeric question for the year and single select categorical question with 12 categories for months.

jeanbernard points to a good solution: indeed the century-month codes were designed exactly for the reason that you can avoid specifying the full date in the case when the day is not known, which is sufficient for many situations, such as measuring the age of a child in months for the z-score functions, and other similar applications.

CenturyMonthCode(month, year) - computes the century month code based on the month and the year.

Note that while you can calculate a century month code conveniently with this function, entry is not as convenient since there is no corresponding question type for it.

Still see if the example section “Calculate child age in months” in “Public example User questions and common patterns” is delivering the desired experience.

Best, Sergiy Radyakn