Gossamer Forum
Home : Products : DBMan : Customization :

calculation on based on date field

Quote Reply
calculation on based on date field
Hi,

I haven't purchased DB Man yet, but I was wondering how difficult it would be to use the value of a date field to calculate the value of another field. In other words, I would have a field called "DateSubmitted" and another called something like "DaysSinceSubmission". The second field would be calculated by taking the "DateSubmitted" and subtracting it from the current date.

Would this be difficult to do? I have almost 0 knowledge of perl programming, although I have done a little programming in asp.

Thanks for any suggestions.
Quote Reply
Re: [tnsbuff] calculation on based on date field In reply to
Your best bet would be to store unix timestamps (time() in perl) rather than dates. This represents epoch time and will be much easier to work with than a date.

You can then do $time1 - $time2

Last edited by:

Paul: Dec 18, 2002, 4:41 PM
Quote Reply
Re: [tnsbuff] calculation on based on date field In reply to
Check out this thread reference as it may provide an easy solution:

Subject: Number of days a record has been in the database
Thijs Goos 5-Apr-00
Thread: http://gossamer-threads.com/p/14064

I believe this will provide what you need.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] calculation on based on date field In reply to
Thank you both very much. I think that thread has just what I need, Lois. I'll let you know how it went when I get to that point.

Thanks again!