dawsonrhodes
Member
- Local time
- Today, 08:11
- Joined
- Mar 8, 2020
- Messages
- 85
Hello! Thanks for your reply and code!The problem is, I think, the contents of that drop-down. Rather than digging through your DB, I'll ask a more direct question.
In the record where you have an absence, what actually gets stored in the field that tells you the type of absence? Is it a code number? Is it a code letter? Is it a word like "sick" ? The WHERE clause should include the code or value and the name of the field.
E.G. if you actually use the word SICK or the lower-case version thereof, ....
Code:WHERE [Type of Leave/Exception] = 'sick' AND other possible conditions
Obviously, if you use an exception code rather than the word 'sick' then you have to compare to something else.
The dropdown is a word, which is Sick, Emergency and so on.
So I am just unsure where this code belongs, should it be added as a field in the query design, like Number of Sick Days: WHERE [Type of Leave/Exception] = 'sick' AND other possible conditions?
I am trying to calculate the number of days between the absence start date and end date, but only for the records that are "sick", all others I am looking to return the calculation as "0".
As I mentioned one of the fields in the "Attendance Extended" Query is Number of Days: DateDiff('d',[Employee Attendance.Start Date],[Employee Attendance.End Date],+1) Which works with no issues.
Hope this clarifies what I am trying to accomplish...
Thanks in advance!