- Posts: 25
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Limit date range in functon of previous answers
- limes4LN
- Topic Author
- Offline
- Junior Member
Less
More
9 years 6 months ago #113600
by limes4LN
Limit date range in functon of previous answers was created by limes4LN
Hi,
Can I set a limit of the date range in a date field according to previous answers. For example :
Question 1 : Are you an adult, teenager ou child ?
Question 2 : Your birthday please ? (if Q1=child, then possible answers for Q2 = 2014-01-01 < Q2 < 2004-01-01, if Q1=adult, then possible answers for Q2 = 1994-01-01 < Q2 < 1910-01-01; etc.)
Can I set a limit of the date range in a date field according to previous answers. For example :
Question 1 : Are you an adult, teenager ou child ?
Question 2 : Your birthday please ? (if Q1=child, then possible answers for Q2 = 2014-01-01 < Q2 < 2004-01-01, if Q1=adult, then possible answers for Q2 = 1994-01-01 < Q2 < 1910-01-01; etc.)
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
9 years 6 months ago #113605
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Limit date range in functon of previous answers
I don't think you can use Expression Manager to set the minimum an maximum dates.
The simplest solution would probably be three separate "birthday" questions shown conditionally depending on the "age group" question.
.
The simplest solution would probably be three separate "birthday" questions shown conditionally depending on the "age group" question.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
9 years 6 months ago #113606
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Limit date range in functon of previous answers
Oh, wait, I stand corrected. You can use EM in those settings -
manual.limesurvey.org/Question_type_-_Da...9_.28New_in_2.05_.29
So, maybe something like this for the minimum date setting:
So, maybe something like this for the minimum date setting:
Code:
if(q1 == 1, '2004-01-01', if(q1 == 2, '1994-01-01', '1910-01-01'))
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.