This topic is locked

Calculate Dates

7/4/2006 7:30:46 AM
PHPRunner General questions
D
dieter author

I have a field Date (21.03.1995).

There is another Field Integer (48 e.g.).
I would like to add 48 months = 4 Years to the date field (21.03.1999)
or 47 months ==> 21.02.1999
th new Date should be displayed in a field in List and viewpage.
is this possible ?
Dieter <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=2937&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

Alexey admin 7/4/2006

Dieter,
sure, just add a calculated field on the Edit SQL query tab.

Modify SQL string this way:

select

...

DateField,

IntegerField,

DATE_ADD(DateField, INTERVAL IntegerField MONTH) as AddedDate,

...

D
dieter author 7/4/2006

Dieter,

sure, just add a calculated field on the Edit SQL query tab.

Modify SQL string this way:


works fine
thanks
Dieter