Re: event update

Tech-Archive recommends: Fix windows errors by optimizing your registry



Here is a better understanding of what I am trying to do.
Standard=amount to be kept on hand
Used=how many haave been used
Ordered=how many were ordered
CurrentCount=amount ordered
diff=amount to be carried over to next week
I'm not sure using a date field is what I need. Any other suggetions?

"Michel Walsh" wrote:

> Hi,
>
>
> You should do the computation in a query. Doing it under a form event means
> you have to get the right record and the right "event firing stimulus",
> which is quite unreliable.
>
>
>
> If your table have a dateTime field, then
>
>
> SELECT a.*, b.*
> FROM myTable As a LEFT JOIN myTable AS b ON b.dateTime < a.dateTime
> WHERE b.dateTime IS NULL or b.dateTime=(SELECT MAX(c.dateTime) FROM myTable
> as c WHERE c.dateTime<a.dateTime)
>
>
> should "match" the records such as b.* is the record occurring immediately
> before a.*. In other words
>
> a.fieldName - b.fieldName
>
>
> subtract the value in the said field name from two "successive" records
> (succession through their dateTime value).
>
>
> On the other hand, if you just need the SUM up to the datetime, a running
> sum, then, try:
>
>
> SELECT a.dateTime, SUM(b.amount)
> FROM myTable As a INNER JOIN myTable As b
> ON a.dateTime >= b.dateTIme
> GROUP BY a.dateTime
>
>
>
> Hoping it may help,
> Vanderghast, Access MVP
>
>
>
> "justlearnin" <justlearnin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:BE8C2240-DBE9-487F-8924-69949E386C4F@xxxxxxxxxxxxxxxx
> >I have a feild that I want to be updated from another feild in a form, but
> >I
> > cant use on current because it adds the value each time I open it. What
> > would
> > be the best event to use for this?
> > Me.Diff = Me.CurrentCount - Me.Standard
> > Diff is being passed so that it can be used in the next weeks totals. This
> > way the current count of the next week starts out with Diff added into it.
>
>
>
.



Relevant Pages

  • Re: event update
    ... Doing it under a form event means ... (succession through their dateTime value). ... >I have a feild that I want to be updated from another feild in a form, ... > way the current count of the next week starts out with Diff added into it. ...
    (microsoft.public.access.forms)
  • Re: Extended date and time
    ... I want to convert between seconds from the epoch (let's say 1970 in floating ... Is there any way to convert a datetime into seconds from a certain date? ... print "diff", repr ... print "sdiff", repr ...
    (comp.lang.python)
  • Re: Hourly volume calculation
    ... I recommend starting with a table representing the 24 hour period. ... Fix this up for your table and column names (YourTable and DateTime). ... field consisting multiple volume entries. ... I need to sum up the volumes by ...
    (microsoft.public.access.queries)
  • Cast and convert
    ... This statment do the sum of some DateTime fields... ... But if ONE of thoses fields is null then the entire result is null. ...
    (borland.public.delphi.database.ado)
  • Re: Format Seconds
    ... > Is there a quick way or component to take the time in-between two DateTime ... > arguments and format it like this: ... Diff: TDateTime; ... regardless of user's locale settings ...
    (borland.public.delphi.thirdpartytools.general)