Hi, you may use this equation:
Q1: the question where the date is entered.
Q1a: the question where the added days are entered
{date('Y-m-d',mktime(0,0,0,substr(Q1,5,2),sum(substr(Q1,8,2),Q1a),substr(Q1,0,4)))}
Explanation:
The date in Q1 has a format YYYY-MM-DD; this is the format the database stores a date.
mktime is a function to create a UNIX timestamp for a date and takes the parameters
mktime(hour , minute , second , month , day , year)
We neclect the time, but then we take the substring of the date from index 5 and 2 characters long (this is the month)
Then we take the substring of the date from index 8 and 2 characters long (this is the day)
At last we take the substring of the date from index 0 and 4 characters long (this is the year)
You also see the sum
{date('Y-m-d',mktime(0,0,0,substr(Q1,5,2),sum(substr(Q1,8,2),Q1a),substr(Q1,0,4)))}
Here we add the value of question Q1a to the day parameter.
{date('Y-m-d',mktime(0,0,0,substr(Q1,5,2),sum(substr(Q1,8,2),Q1a),substr(Q1,0,4)))}
And at last we recalculate to a date with the "date" function.
This function has two parameters, the date format and the timestamp.
All these functions are explained here
www.limesurvey.org/manual/ExpressionScri...mplemented_functions
Examples with two different date formats.
To do calculations you should always use "Y-m-d".
and
Joffm