I have been pulling my hair out over an issue where a form and report are not giving me correct info when determining if one date field is between 2 other date fields. :banghead:
I thought my database had become corrupted but I can actually duplicate the behavior in another database.
I have attached a small sample database which will duplicate what appears to be a real problem.
1. Open the database, then open the form DateTest.
2. Select 6/12/2018 in the 'Start Date' field and click 'Update'
3. The 'GetStartDate' field will determine the first day of that week, 6/10/2018
4. The 'DateAdd' field will determine the last day of the week, 6/16/2018
5. Select any date between 6/2/2018 and 6/9/2018 in the 'New Date' field and click 'Update'
6. See that Access thinks that any of these dates is actually between 6/10/2018 and 6/16/2018.
You can rewrite the iif() function in the 'Between' field any way you want and the results are the same.
You can see what is going on in design view of the form. Ignore all the hidden fields, they were just for experimentation. The GetweekStartDate function is in Module 1.
Is there a logical explanation for why this is happening?
Thanks
I thought my database had become corrupted but I can actually duplicate the behavior in another database.
I have attached a small sample database which will duplicate what appears to be a real problem.
1. Open the database, then open the form DateTest.
2. Select 6/12/2018 in the 'Start Date' field and click 'Update'
3. The 'GetStartDate' field will determine the first day of that week, 6/10/2018
4. The 'DateAdd' field will determine the last day of the week, 6/16/2018
5. Select any date between 6/2/2018 and 6/9/2018 in the 'New Date' field and click 'Update'
6. See that Access thinks that any of these dates is actually between 6/10/2018 and 6/16/2018.
You can rewrite the iif() function in the 'Between' field any way you want and the results are the same.
You can see what is going on in design view of the form. Ignore all the hidden fields, they were just for experimentation. The GetweekStartDate function is in Module 1.
Is there a logical explanation for why this is happening?
Thanks