automatic calculation on each record on column

Skip to first unread message

Thomas Colvin

Jan 9, 2014, 9:37:56 PM1/9/14
Have a table and everything is working fine.

One column has heading of Date of Birth. The next column heading is Age.

What I would like to happen is when little program running and I type in the date of birth then program automatically calculates and installs the age in the adjoining column record out to two decimals.

How do I do that?

Thanks, Thomas

Dr J R Stockton

Jan 11, 2014, 3:46:47 PM1/11/14
In comp.lang.pascal.delphi.databases message <c48e1eeb-532d-43c8-8e1f->, Thu, 9 Jan 2014 18:37:56, Thomas Colvin
<> posted:
Because years are not all the same length, you will have to think quite
carefully about what you mean by that, especially if your answer is to
be compared with someone else's.

The average length of a Gregorian calendar year is 365.2425 days. But
the average length of a Gregorian year during the lifetimes of those now
alive is very nearly 365.25 days.

Note <>.

(c) John Stockton, nr London, UK. E-mail, see Home Page. Turnpike v6.05.
Website <> - w. FAQish topics, links, acronyms
PAS EXE etc. : <> - see in 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Bernard Peek

Jan 14, 2014, 12:52:00 PM1/14/14
This is something that many databases can handle for themselves. You
could define a new virtual column calculated from the birth data and the
current date or you could use SQL.

Bernard Peek
Reply all
Reply to author
0 new messages