Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [jean] Pre-Sales Question - Can the tables calculate entries

Quote Reply
Re: [jean] Pre-Sales Question - Can the tables calculate entries In reply to
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
Subject Author Views Date
Thread Pre-Sales Question - Can the tables calculate entries Ground Zero 4932 Mar 28, 2002, 12:48 AM
Thread Re: [Ground Zero] Pre-Sales Question - Can the tables calculate entries
jean 4855 Apr 3, 2002, 11:20 AM
Thread Re: [jean] Pre-Sales Question - Can the tables calculate entries
hennagaijin 4716 Jun 6, 2002, 6:28 AM
Thread Re: [hennagaijin] Pre-Sales Question - Can the tables calculate entries
ArtistikDD 4447 Dec 2, 2002, 8:39 PM
Thread Re: [ArtistikDD] Pre-Sales Question - Can the tables calculate entries
hennagaijin 4472 Dec 3, 2002, 6:30 AM
Thread Re: [hennagaijin] Pre-Sales Question - Can the tables calculate entries
ArtistikDD 4423 Dec 3, 2002, 7:43 PM
Post Re: [ArtistikDD] Pre-Sales Question - Can the tables calculate entries
NetAgent 4292 Jan 29, 2003, 10:19 AM