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 
Query
Taruna Matharu 

4 years ago
Hello Experts,

I have a continuous form that enter dates and a query that gets date calculation result in another column. Everything is working fine except in the continuous form it add an extra row an the column that has this query displays #ERROR

The query is mentioned below.

SELECT PIFNewProjectTBL.ProjectID, PIFNewProjectTBL.PDocumentType, PIFNewProjectTBL.PDocuTypeRev, PIFNewProjectTBL.EOIDate, PIFNewProjectTBL.EOIDueDate, PIFNewProjectTBL.EOIReceivedDate, IIf([EOIDate] Is Not Null,Switch([EOIReceivedDate]<=[EOIDueDate],"On Time",[EOIReceivedDate]>[EOIDueDate],"Late",[EOIReceivedDate] Is Null And [EOIDueDate]Date(),"Not Due"),"") AS PIFRespStat
FROM PIFNewProjectTBL;


Please guide.

Thanks
Taruna
Taruna Matharu OP  @Reply  

4 years ago

Kevin Robertson  @Reply  
          
4 years ago
It looks like you are getting the error because EOIDueDate is null. You are checking for a null value in EOIDate, but not EOIDueDate which your Switch function appears to be based on.
Alex Hedley  @Reply  
           
4 years ago
Is EOIDate Null for a new record?

IIf([EOIDate] Is Not Null,Switch([EOIReceivedDate]<=[EOIDueDate],"On Time",[EOIReceivedDate]>[EOIDueDate],"Late",[EOIReceivedDate] Is Null And [EOIDueDate]Date(),"Not Due"),"") AS PIFRespStat
Alex Hedley  @Reply  
           
4 years ago
Should this have a condition?
And [EOIDueDate]Date()
Taruna Matharu OP  @Reply  

4 years ago
What I am looking for is the query to  perform the SWITCH only if (Expression of Interests Issued Date) EOIDate is not empty. EOI DUE DATE is auto calculated once we enter EOIDATE. Once user receives EOI he enters the Received Date. PIF Resp Status - The status of ON Time, Late, Over Due, is then bases on that or if Received Date if empty then to use the Date().
Taruna Matharu OP  @Reply  

4 years ago
Kevin and Alex,

Still getting the ERROR in  the new blank row. Please guide

PIFRespStat: IIf([EOIDate] Is Not Null,Switch([EOIReceivedDate]<=[EOIDueDate],"On Time",[EOIReceivedDate]>[EOIDueDate],"Late",[EOIReceivedDate] Is Null And [EOIDueDate]<Date(),"Over Due",[EOIDueDate]>Date(),"Not Due")," ")

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/7/2026 9:21:18 AM. PLT: 0s