automatic calculation on each record on column

2 views
Skip to first unread message

Thomas Colvin

unread,
Jan 9, 2014, 9:37:56 PM1/9/14
to
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

unread,
Jan 11, 2014, 3:46:47 PM1/11/14
to
In comp.lang.pascal.delphi.databases message <c48e1eeb-532d-43c8-8e1f-
b55aca...@googlegroups.com>, Thu, 9 Jan 2014 18:37:56, Thomas Colvin
<colvins...@gmail.com> 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 <http://en.wikipedia.org/wiki/Oldest_person>.

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

Bernard Peek

unread,
Jan 14, 2014, 12:52:00 PM1/14/14
to
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
b...@shrdlu.com
Reply all
Reply to author
Forward
0 new messages