Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - DaysBetweenQuery.mdb (beginner)(2000-2007)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

>
Want a good read? Try The Summer of His Life (available on Amazon!)

DaysBetweenQuery.mdb (beginner)(2000-2007)

 Post Reply Post Reply
Author
Message
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 261
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: DaysBetweenQuery.mdb (beginner)(2000-2007)
    Posted: 29 Jan 2009 at 5:33am
Please consider donating $1 per sample downloaded, find out why here.
 
DaysBetweenQuery.mdb
 
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!

Download
Access 2000+ (17 KB): 
DaysBetweenQuery.zip
Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links
>
Want a good read? Try The Summer of His Life (available on Amazon!)

Back to Top
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 261
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 2010 at 9:40am

Update:  Added detailed documentation.

Consider donating $1 per sample downloaded, find out why here.<
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.