Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simple calculation?

1 view
Skip to first unread message

Dan

unread,
Mar 15, 2002, 11:15:52 PM3/15/02
to
Hello all,

I have 3 fields in a timekeeping datbase: Start, End, and Length. All
3 are times.

How would I go about auto-entering the third value if any two values
are known without using a script? It must work if any of the three are
modified as well.

Start = End - Length
End = Start + Length
Length = Start - End

I've tried triggered lookups to no avail: the lookups invariably cause
a circular definition, and if you force the lookups, the DB goes
corrupt.

Got any ideas, cause I'm temporarily out.

Thanks!!

-Dan

John Weinshel

unread,
Mar 15, 2002, 11:26:48 PM3/15/02
to
Length = End-Start

...where "Length" is a calculation, returning Time.

Note this calc breaks if the times cross midnight; you then have to deal
with days.

--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance


"Dan" <zp...@yahoo.com> wrote in message
news:b13bde1d.02031...@posting.google.com...

Colin Bannister

unread,
Mar 16, 2002, 11:07:14 AM3/16/02
to
Try creating three calculated fields cStart, cEnd, cLength.
Each of these items can then be calculated along the lines of
cStart = If(Start = "", End-Length , Start) etc etc

Hope this helps

Regards
Colin Banister


"Dan" <zp...@yahoo.com> wrote in message
news:b13bde1d.02031...@posting.google.com...

Dan

unread,
Mar 16, 2002, 8:28:50 PM3/16/02
to
Thanks, but that's only part of what I'm after- getting "cStart" back
into "Start" etc. is where I'm running into problems.

I'm trying to let users enter and update data in a variety of ways,
because that's how we receive the data. For example, if "Start" was
7:42AM and the "Length" was 2:27, "End" should calculate automatically
to 10:09AM. Later, I should also be able to go to "End" and change it
to 9:45AM , which would update "Length" to 2:03. (This way users don't
have to calculate anything manually)

To define it more clearly:

If I enter a time into Start, it auto-enters End (Start+Length)
If I enter a time into Length, it auto-enters End (Start + Length)
If I enter a time into End, it auto-enters Length (End - Start)

To answer John's prior post, midnight is not a factor, and Length =
End-Start.

-Dan


"Colin Bannister" <co...@bannister.me.uk> wrote in message news:<a6vqfi$6qb$1...@newsg1.svr.pol.co.uk>...

Colin Bannister

unread,
Mar 17, 2002, 12:49:20 PM3/17/02
to
I guess it's make your mind up time. A field is either for data entry or
calculation. The only way to automate the three entry fields is through the
use of a script attached to a button which the user clicks after entering
two of the three fields. But you don't really want to hear that, do you?

Imagine your user has two fields completed and the system auto enters the
third. What happens if your user decides to manually over-ride the third
after deciding thats the field he should have completed instead of the
second? Do you then end up with End and Length with the same value? What
takes priority?

Can't go much further I'm afraid.

Regards
Colin Bannister

Bridget Eley

unread,
Mar 17, 2002, 1:34:24 PM3/17/02
to
Make each field a button that runs a script that first checks if there are
values in the other two fields (using If and not IsEmpty), if so, sets the
field to the appropriate calculated value (Set Field) then goes to and
selects the field (Go to Field [Select/perform, FieldName)], if not, just
goes to and selects the field. You will still have to click in each field,
but the last field to be clicked, regardless of order, will auto-enter.

This approach is not without problems: If amendments are made to one field,
the other fields will not automatically update as they would with calc
fields. Any other field that would be affected must be clicked too - will
users remember to do it, and will they know which other field has to be
updated because which field makes a big difference. For example, if you
amend the Start, clicking End will adjust End to be Start + Time. If you
click Time, it will adjust Time to be End - Start.

--
Bridget Eley

in article b13bde1d.02031...@posting.google.com, Dan at
zp...@yahoo.com wrote on 3/16/02 2:15 pm:

chris

unread,
Mar 17, 2002, 5:01:45 PM3/17/02
to
3 time fields (not calcs). 3 layouts, each with all three fields but only
one of which allows data entry and a button which acts on the currently
entered value. When you click on either of the other two values you are
taken to another layout which does allow you to enter data in that field. In
each case the button would consider the freshly entered data to override
data in the other two fields.

In practice the user won't notice the skipping from layout to layout; he/she
clicks on the field and it highlights to accept data entry. Click the button
to post the data and all 3 fields are reconciled.

Chris

0 new messages