This topic is locked

From date of birthday to age

6/15/2006 5:27:20 AM
PHPRunner General questions
A
albo author

Hi <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=2785&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

i have a little problem:

i have a field that contains the date of birth, and in the details, i need the actual age of that person.

It's possible to have the result with phprunner or i need to hack manually the php code?

If phprunner doesn't support this function anyone can tell me how to hack the code please?
Thx and sorry for bad english <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=2785&image=2&table=forumtopics' class='bbc_emoticon' alt=':)' />

J
Jane 6/15/2006

Hi,
you can do it using events.

If you give me the structure of your tables and more detailed description of what you want to achieve I'll help you.

A
albo author 6/15/2006

thx <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=9107&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

the db is very big (a lot of fields), better if i can send you an email with all, structure and description. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=9107&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />

Sergey Kornilov admin 6/15/2006

Albo,
you can use custom SQL query on "SQL query" screen in PHPRunner

select ...,

floor(datediff(now(),`date of birth`)/365)

from ...


This calculation is not 100% percent exact however it's rather simple.

O
osluk 6/15/2006

Sergey
I have the recent 2005 price also old price for 2004 and 2000 price.
If I want to populate fields "percentage price increase from 2000 to 2004"

and "percentage price increase from 2004 to 2005" what code or event

would I need?
Cheers Chris

J
Jane 6/16/2006

Chris,
you can use calculated fields.

Here is an example:

select ...,

`price2004`*100/`price2000` as `percentage price increase from 2000 to 2004`,

`price2005`*100/`price2004` as `percentage price increase from 2004 to 2005`

from ...



where price2000, price2004 and price2005 are your actual field names.
Read more information here:

http://xlinesoft.com/asprunnerpro/articles...ated_fields.htm

and

http://www.xlinesoft.com/phprunner/docs/sql_query_page.htm