Patrick,
   I copied and pasted your code into a test table and it seemed
to work fine.  Please note that the field will not change until
the record has actually been saved or accessed.  Yet a select
command should cause it to be recalculated.

For instance with ChildBirthday null, a select statement showed
the calculated date as 0.

Then I issued an UPDATE testtable set ChildBirthday = '05/03/2003'

The select statement then showed the calculated column as 2.

This particular version was release 80,  So I think your logic is
fine and the code you posted worked fine in my test table.
Try a select statement, then an update command, and then
the same select statement and see if it updates as my test did.

-Bob


Thompson Technology Consultants
276 Chippewa
LaPorte, IN 46350
219-324-2605 (Phone & Fax)
219-363-7441 (Cell)
http://ttc.inc.home.comcast.net



-----Original Message-----
From:   Patrick Murphy [SMTP:[EMAIL PROTECTED]
Sent:   Tuesday, May 03, 2005 5:30 PM
To:     RBASE-L Mailing List
Subject:        [RBASE-L] - Refreshing Calculated Field in Table

BlankI have an calculated integer field in a table that determines a 
person's age.  The calculation is:
(IFNULL(ChildBirthday,0,((.#date- ChildBirthday) / 365.25)))

I just discovered that the calculated age has not automatically updated for 
persons with birthdays in the last several months.  So someone with a 
4/1/2003 birthday is still showing an age of 1, rather than 2.  Current 
system date is correct.  I edited the column definitions and forced a table 
save, and that did result in the ages being refreshed, but obviously that 
is not a solution.

I assumed calculated columns were refreshed whenever the table was 
accessed, such as when editing, printing a report, or browsing , but 
perhaps not.  Can anyone help me out here?  How do I make sure that field 
contains the correct age?

Patrick
6.5++/7.1 << File: ATT00015.html >> 

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: 
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, 
place any 
text to search for.
================================================

Reply via email to