Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
End of Life Criteria
Walter Hamilton 
    
4 years ago
I have a form used to displace depreciable assets for the Home Office and for Customer Site.  I have a calculated filed in the Record Source

EOL: DateAdd("m:,[LifeCycleMonths],[PurchaseDate]) which displays the date the item should be retired.

Everything works until I try to add the criteria that the EOL should be >Date()

I get and error that says

Data type mismatch in criteria expression

I'll attach a several screenshots as well.
Walter Hamilton OP  @Reply  
    
4 years ago

Walter Hamilton OP  @Reply  
    
4 years ago

Walter Hamilton OP  @Reply  
    
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
Do it the other way, you may need to use 2 queries. One to sort the LifeCycle/Purchase Date to >Date() and the second one to do the DateAdd function on those already filtered fields.
Walter Hamilton OP  @Reply  
    
4 years ago
Adam - Thanks.  I'll try that.
Walter Hamilton OP  @Reply  
    
4 years ago
Adam - I was able to get this to work by using the following criteria in the PurchaseDate field:

>Date()-(([LifeCycleMonths]/12)*365)

I always got an error when adding the >Date() Criteria to my EOL calculation.
Adam Schwanz  @Reply  
           
4 years ago
I see, I'm not a fan of *365 because of leap year causing some silly stuff sometimes. (Maybe not in this case)

What about trying DateDiff if we are just going to subtract them? DateDiff

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: 8/8/2026 10:45:51 AM. PLT: 1s