Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I put a calculated field inside a Table

Status
Not open for further replies.

thejam

Technical User
Jul 3, 2003
8
AU
HI,

I have a customer datebase in Paradox version 10 of about 30,000 customers. When I created the database I put in a birthdate field and an age field right next to it. I have tried a few things to make the age field automatically calculate the customers age from the birthdate field.........but no luck.

I have created a form which calculates the age but it would be nice if the table was up to date as well.

Is this possible or am I barking up the wrong tree?

thejam
 
thejam,

You can not have a calculated field in a table. You could however have the form update the age field but then the field would be out of date tomorrow. Can't think of a practical way of doing this without a calculated field in a table. Perhaps someone else can.

Perrin
 
thejam,

Perrin's right, saving the current age in the table may not be the best idea as it would be out of date the next day.

You could have your form recalculate the age each time the table was opened, but that wouldn't if you opened a report or query against the table before opening the form.

You can save calculated field values into a table, using ObjectPAL or a query.

What would you like to do with the age? Perhaps that would help us come up with a useful idea.

Hoping to help...

-- Lance
 
the jam,

From my experience with recording DOB within a customer table, we only need to look at the age when viewing the customer details, either on a form or a printed report. All we have are calculated fields on both the form and the report showing the age at that moment in time - there is obviously no point in recording the age in the table even if you wish to know their age when inputting the data, as even this can be calculated from the DOB and the date when the information was recorded.

By the way what sort of application is it you are building? Maybe I can share some of my code.....

Regards,

Lewy
 
Hi Guys,

Thanks heaps to kilot, perrin, lewy and lance and anybody else I might have missed.

You were right. I think I will just stick to looking at my data through my form rather than worrying about the Table. A bit pointless having the Table updated when the next day it is out of date again.

Thanks again and speak to you again soon with another of my maniac tasks.

thejam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top