Thursday, January 29, 2009

New Sample: DaysBetweenQuery.mdb

Author: Roger Carlson

This sample illustrates how to create a "Days Between" query. It shows how to:

1) Display the difference between dates in subsquent records of a table
or
2) Display the difference between dates in subsquent records of a table over a group. In this case, the group is the OrderID field.

There are two methods shown here: Using a 1) correlated subquery and 2) DMax domain aggregate function. The correlated subquery is the faster method, but it returns a non-updateable recordset. The DMax method is slower, but the recordset is updateable.

HOWEVER, it should be noted that against a large dataset, neither method will be very fast!

You can find the sample here: http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=445

Link to top: DaysBetweenQuery.mdb

.

No comments: