- Posts: 6
- Thank you received: 0
- Forum
- English support forums
- Can I do this with LimeSurvey?
- Entering a Year, but not one in the future
Entering a Year, but not one in the future
- BillLenoir
-
Topic Author
- Offline
- Fresh Lemon
-
Less
More
3 years 8 months ago #133901
by BillLenoir
Entering a Year, but not one in the future was created by BillLenoir
I have a numerical input field for the survey respondents to enter a year. I want to make sure that year is not in the future. How can I use Expression Manager in the question validation to ensure this?
I do not want to set the maximum value to 2016, because this survey will be run again in 2017.
I do not want to set the maximum value to 2016, because this survey will be run again in 2017.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 8517
- Karma: 621
- Thank you received: 2615
3 years 8 months ago #133944
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic Entering a Year, but not one in the future
You can use the Expression Manager date() function with a "Y" format to return the current year. So, for example, if you have question code "Q1", the validation equation would be:
Q1 <= date('Y',strtotime('now'))
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: BillLenoir
Please Log in or Create an account to join the conversation.