Re: Subtracting fields between records in a query

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



See:
Referring to a Field in the Previous Record or Next Record
at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;210504

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"AL" <AL@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CCC39A36-679F-460F-8BF5-7C361557997C@xxxxxxxxxxxxxxxx
>
> I have set up the following query:
>
> SELECT [qry Totals to Date].ID, [qry Totals to Date].Date, [qry Totals to
> Date].Supplier, [qry Totals to Date].Reference, [qry Totals to
> Date].Gross,
> [qry Totals to Date].Sample
> FROM [qry Totals to Date];
>
> I want to show for each record an additional field that takes the value in
> the "Sample" field for that records and subtracts from it the value in the
> "Sample" field from the previous record.
>
> The query is sorted in ascending order by "ID" which is an autonumber
> field
> in the original table, but as the query also excludes creatin records from
> the table the ID field will not always increase by 1 each time.
>
> Hope that all made sense!
>
> Any help would be greatly appreciated
>
> AL


.



Relevant Pages