link queries

A

angie

i have one table with the following fields among others:

vehicle plates, previous kms, current kms, date, location. i have created a
query that draws all data from my table and it works fine.
i have also created another query with a calculated field that adds one
month to the date mentioned above.
my aim is to show the current kms of the month as the previous kms of the
following month.
i have tried to link the two queries but instead of returning 200 records i
get 974 records.
how can i solve this problem? do i need the two queries?
 
A

angie

thannk gor the reply, this works fine if there is a primary key in the table
and data are entered by users in a sequence. unfortunately there is no
primary key in the table and many users enter data randomly. e.g. a user may
enter data for january 2009 and another user may enter data for december
2008.
could i use this function to retrieve data from e.g.
year:2009, month: jan, starting kms: 5000, current kms: 10000, plates:
YAB3658, location: crete
i want to retrieve for this record in a calculated field the "current kms"
of december 2008 (provided that the fields "plates" are the same).

could i achieve that?

Ο χÏήστης "MGFoster" έγγÏαψε:
 
A

angie

ok, i have created a primary key for my table, but it is an expression. i
have entered the following function and it returns an error. can you help me
fix it?

Expr3: DLookUp("[current kms]";"EXPENSES-TBL-3";" [EXPENSES-TBL-3].Expr1=" &
[EXPENSES-TBL-3].[Expr1]-1)

Ο χÏήστης "MGFoster" έγγÏαψε:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top