Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Next Appointment    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
DateAdd February
Len Jolly 
     
3 years ago
Hi, I have a monthly rental due date, which when marked as paid the next due date is updated in a query by the DateAdd function. This works correctly except if the payment date is say the 30th of Jan the next date is calculate as the 28th Feb (which is fine) but from then on the payment calculates as the 28th of each month not the 30th. How can I make the due date revert to the correct date?
Alex Hedley  @Reply  
           
3 years ago
Scott Axton  @Reply  
        
3 years ago
Len
Just by your description I'm guessing that your due date is the last day of the month.  Correct?

If that is true, I would base your DateAdd on the 1st Day of next month then subtract one day. Remember ALL months have a 1st of the month but the last day varies (30,31, 28, and sometimes 29 in a leap year).
Give it a shot and see what you come up with.  You'll remember it better if you solve on your own, but if you hit a wall post your formula and we'll help you through it.

Re-watch the Access Expert 28 lessons if you need a refresher.
Len Jolly OP  @Reply  
     
3 years ago
Sorry guys I did not explain enough. There is not just one due date. There are a number of clients and each have their own due date depending on when they started renting. So the due date can be any day of the month.
Scott Axton  @Reply  
        
3 years ago
Do you store the clients start date anywhere?  Could you use DLookup to get the Day of renewal? Then use DateSerial to calculate the next date.
Len Jolly OP  @Reply  
     
3 years ago
Thanks Scott. Sounds like A plan. I will give it a try and let you know
Len Jolly OP  @Reply  
     
3 years ago
Hi, I Have a 'TenantSince' field which is the start date and creates the monthly payment date. After going back through Expert 28
and other tutorials I managed to create this query. Creating a new dummy tenant who started on the 30th December 22.I ran the updates andGot these results. As you will see it works to start with, but makes the Feb payment in March and for obvious reasons then jumps to April. I cannot figure whats wrong, I'm hoping it's obvious to you guys as my head is buzzing! Images to follow
Len Jolly OP  @Reply  
     
3 years ago

Len Jolly OP  @Reply  
     
3 years ago

Kevin Robertson  @Reply  
          
3 years ago
Try doing it like in my screenshot below.
Kevin Robertson  @Reply  
          
3 years ago

Len Jolly OP  @Reply  
     
3 years ago
Thanks Kevin, that looks good, I will give it a try
Len Jolly OP  @Reply  
     
3 years ago
I've now changed from a query to the code kindly posted by Kevin. But although I'm now getting the Feb update as expected March still updates based on the Feb date. see list
Len Jolly OP  @Reply  
     
3 years ago

Len Jolly OP  @Reply  
     
3 years ago
Cannot figure out why it will not work. These dates are affecting the rental period calculations, which causes errors on payment receipts, remittance advice and other reports. I think I will try to correct March & future dates by DLookUp of the day number of the the first ever rent payment after the above code has run!
Len Jolly OP  @Reply  
     
3 years ago
I am now getting the correct dates, but only by a correction routine if the date is wrong in month 3. This seems a bit of a bodge.
There must be a better way. Has this problem not come up before?

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

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: 6/14/2026 2:29:51 AM. PLT: 0s