Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Subtracting Dates From Records
Susan 
    
14 years ago
I have a table with the following fields:
Date, Left Door, LDDiff, Right Door, RDDiff

Each day, the number of people who came to the library will be entered into the Left Door field. So, on Oct. 31, the left door count was 10652 and on November 1, the left door count was 8956. I'd like the LDDiff to display the difference between the the two dates.


Reply from Richard Rost:

First, don't use "Date" as a field name. It's a reserved word in Access. You should use "MyDate" or something like that. Trust me.

If you have all consecutive dates in your database, you could create a calculated query field with DLOOKUP like this:

YesterdaysAmount: DLOOKUP("LeftDoor","MyTable","MyDate=#" & MyDate-1 & "#")

This says "look up the value LeftDoor from the MyTable table where the date of that record is equal to ONE DAY BEFORE the date of the current record.

Now you can perform your subtraction.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/16/2026 3:19:00 PM. PLT: 1s