I have a problem that's simular but less complex:
I want to set up a DB where field 0 is one day after the date in field=20=
0 of the previous record. I've tried to read about inter-record=20
scripts, but it=92s beyond me!
Laura Beryl Gray
On Oct 10, 2005, at 9:30 AM, Samuel F. Montalvo wrote:
> Hi everyone!
>
> After searching in the mailing archive of PilotDB and reading the=20
> scripts.txt file, I didn't found any example of calculations with the=20=
> 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=20=
> 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=20
> current date (today)
>
> [Calculated Field (Theory)]
> Field2 ->=A0=A0 (dur (- (int gcd)(int %1)))
>
> [The Problem]
> (int gcd) always report a "strange" number. For example, for=20
> 10/10/2005 it resolves as 1120971
>
> But if I create a 3rd field as:=A0 Field3=A0 ->=A0 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=20=
> 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,=20
> 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=20=
> the same date?
>
> Thanks in advance!
> --
>
> Samuel F. Montalvo
> MComm / TuPalMX
> Guadalajara, Jalisco MEXICO
> Web: http://tupalmx.com=
|