Calculations within queries..

  • Thread starter Thread starter zowow via AccessMonster.com
  • Start date Start date
Z

zowow via AccessMonster.com

I'm designing a database so i can keep track of queries at work...
I have designed it but I want queries that are over two days old to be
escalated

there is a form where i fill out the query, and a subform which stores
updates.

I need to do the following;

a) Have a query that will work out whether theres an update to the record and
if there is, take the date of the LAST update and store it somewhere?

b) Find out whether the last update < todays date, if so mark an escalation
form on the main box as ticked..

at the moment i have a query that checks the difference between the last
update date and todays date, and displays the answer, trouble is this
displays a result for every update rather than showing the last update on
that particular record.

i know you can use that function that will do date of last activity, but
thats no good if it alters the date if you save the record for instance.

Any help will be appreciated... :)
Thanks...

I try and avoid code cause it scares me.. haha
 
In a query, you can find the last date in a list by using the function DMax()
in the Date field:

DMax("[UpdateDate]","[DataTable]","[RecordID]=" & [RecordID])

This allows you to find the most current date for a given identifier. If
[RecordID] is non-numeric, you'll have to enclose the criteria in quotes:

DMax("[UpdateDate]","[DataTable]","[RecordID]='" & [RecordID] & "'")
 
Back
Top