jadams0173
Technical User
- Feb 18, 2005
- 1,210
Hey all. I've got a function that I use to so I can summarize some data. A query calls the function and the function returns 1st,2nd or 3rd based on a time only stamp.
For some reason the part that would return 3rd is no longer working but 1st and 2nd work fine. The data in the Time column is stored as Date/Time data type in the table.
Values like 6:40:22 AM , 6:38:39 AM, 11:02:03 PM are being returned as "UNK"
Here is the query:
And here is the SHIFTCHECKING function
I'm stumped. Any ideas?
For some reason the part that would return 3rd is no longer working but 1st and 2nd work fine. The data in the Time column is stored as Date/Time data type in the table.
Values like 6:40:22 AM , 6:38:39 AM, 11:02:03 PM are being returned as "UNK"
Here is the query:
Code:
SELECT tblCheckedIn.Location, tblCheckedIn.CheckedInBy, tblCheckedIn.OpCheckInName, tblCheckedIn.Date, tblCheckedIn.Time, SHIFTCHECKIN([TIME]) AS SHIFT
FROM tblCheckedIn
ORDER BY tblCheckedIn.Date, tblCheckedIn.Time;
And here is the SHIFTCHECKING function
Code:
Function SHIFTCHECKIN(CHECKTIME As Date) As String
' Debug.Print CHECKTIME
Select Case CHECKTIME
Case "7:00:01 AM" To "3:00:00 PM"
SHIFTCHECKIN = "1ST"
Case "3:00:01 PM" To "11:00:00 PM"
SHIFTCHECKIN = "2ND"
Case "11:00:01 PM" To "7:00:00 AM"
SHIFTCHECKIN = "3RD"
Case Else
SHIFTCHECKIN = "UNK"
End Select
End Function
I'm stumped. Any ideas?