View Full Version : Query Problem


sacareer
10-01-2001, 10:59 PM
I am a first time user of this forum and dont know all the access jargon so bear with me.

I set up a query some time ago to show the current "Phase" a client is in. On average a client changes "phase" every 3-6 mths so I set the query to show the last record using the Total function. Changes are entered in date order and the query worked perfectly but in the past month it is no longer showing the last record but other records with no consistency. I have no idea why my query is no longer showing the last record. I built the query again, repaired the db and still have the problem. Can anyone help?

Rich
10-02-2001, 12:31 AM
How did you derive the "last" record. If your using a date field then use Max not last.

sacareer
10-02-2001, 03:27 PM
My Query has "date" and "phase" fields and I asked for the last record in the "phase" field. Using max in the date field still shows all dates for a client not just the most recent

Alexandre
10-03-2001, 03:04 PM
You cannot rely on the position of a record in a table to reflect in any way the chronolgy of data entries/updates, unless you have properly associated to your records a field where you register the date/time when the user adds (or makes changes to? depends on what you are interested in) the record.

Example:
your table is
Tbl
-field1
-field2
...

You would add a new field:
Tbl
-DateLastChange
-field1
-field2
...

using the Before Update event of your form, you would then update the DateLastChange
field with the value Now().

Alex