Hi Jean.
I have a similar problem, but on a much simpler scale. I understand how to use globals to perform basic calculations and display the results when a record is displayed, modified, etc. My question, though (and this may demonstrate my near total ignorance of MySQL!), is whether there's a way to set up a particular column so that its value is always the result of some basic calculation from some other column value?
For example - I have a database of members. There is a field called JoinedDate, a field called TerminatedDate, and a field called Duration. I have it set up to enter today's date in JoinedDate every time a record is added. TerminatedDate gets entered by the admin when a member cancels. What I'm trying to figure out how to do, though, is set Duration to always equal either the value of TerminatedDate minus JoinedDate or (when a member is still active) today's date minus JoinedDate. Again, I know how to use template globals to do this for display purposes, but I'm wondering if there's a way to do it directly with the database, whether or not the record is displayed.
Again - I'm sure I'm demonstrating just how little I know about MySQL, but it seems to me that this should be possible.
Any advice would sure be appreciated.
Thanks,
Adam
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
I have a similar problem, but on a much simpler scale. I understand how to use globals to perform basic calculations and display the results when a record is displayed, modified, etc. My question, though (and this may demonstrate my near total ignorance of MySQL!), is whether there's a way to set up a particular column so that its value is always the result of some basic calculation from some other column value?
For example - I have a database of members. There is a field called JoinedDate, a field called TerminatedDate, and a field called Duration. I have it set up to enter today's date in JoinedDate every time a record is added. TerminatedDate gets entered by the admin when a member cancels. What I'm trying to figure out how to do, though, is set Duration to always equal either the value of TerminatedDate minus JoinedDate or (when a member is still active) today's date minus JoinedDate. Again, I know how to use template globals to do this for display purposes, but I'm wondering if there's a way to do it directly with the database, whether or not the record is displayed.
Again - I'm sure I'm demonstrating just how little I know about MySQL, but it seems to me that this should be possible.
Any advice would sure be appreciated.
Thanks,
Adam
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund