From: Samuel F. M. <tu...@gm...> - 2005-10-10 13:30:12
|
Hi everyone! After searching in the mailing archive of PilotDB and reading the scripts.txt file, I didn't found any example of calculations with the current date. This is: difference of days between a date and current. I did the following example, but I have some questions related, and I hope someone can help me to find the answers. [Database] Field0 - Item - String Field1 - When - Date Field2 - Days - Calculated [Goal] - To find the number of days since Field1 was set related to the current date (today) [Calculated Field (Theory)] Field2 -> (dur (- (int gcd)(int %1))) [The Problem] (int gcd) always report a "strange" number. For example, for 10/10/2005 it resolves as 1120971 But if I create a 3rd field as: Field3 -> JustToday - Date and a 4th, as: Field4 -> CalcToday - Calculated and this last as: (int %3), then it resolves as 53529120 If I use this combination (with fields 3 and 4), then Field2 resolves with the correct number of days since the value in Field1 [Questions] Is there a way to calculate the number of days as in this example, without the need to define a 3rd field to store the current date? Why (int gcd) and (int %3) resolves with different values if they are the same date? Thanks in advance! -- Samuel F. Montalvo MComm / TuPalMX Guadalajara, Jalisco MEXICO Web: http://tupalmx.com |