Question on Tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table named "tblJobManagerRevisions" which looks like this

Revision Date
1.1.0 1/3/2006
1.0.5 1/2/2006
1.0.0 23/06/2005

I need to Dlookup the most recent entry, which would be by date. Im
currently using
CurrentRevision = DLookup("[Revision]", "tblDatabaseInformation") which
works fine but i need to guarentee the dlookup function will return the
latest row.

Is this the best way to do this? the date field is sorted by accending or
decending, cant remember but it works. I dont know if it would be better to
create a qry so that it returns only 1 row of data which is the most recent.

Any help would be appreciated
 
This is the first time I ever tried nesting domain aggregate functions like
this. Took a few seconds to think about using single quotes in the DMAX
statement.

It will only work IF your Date field is a date/time datatype. Speaking of
Date, that's a reserved word because there is a Date() function. Sometimes
naming a table or field a reserved words can cause strange problems and
should be avoided. Something like RevDate might be better.

DFirst("[Revision]","tblJobManagerRevisions", "[Date] =
DMAX('[DATE]','ASIF')")

As the "D" functions are known to be somewhat slow, your idea of creating a
query might be best if you notice any performance issues.
 

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

Similar Threads

Dlookup 7
question on dlookup 3
Dlookup question 4
Dlookup Issue in Query Criteria 2
DLookUp Function 1
Function Start and End 8
Use DLookUp to Enter Data into a Table 3
Default value of combo box based on DLookUp 2

Back
Top