Skip to main content

Error requesting absence: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value OR Error evaluating or casting boolean expression

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

H
Written by Harry Ledger
Updated over 3 weeks ago

Overview

This message is generated due to the following reasons:

  1. The user account is not set up to use the System Default Date Time format.

  2. Faulty absence data is being entered in the system.


Check the default date format

The option to change the preferred date format has been removed in v4 and SelectHR Evo to prevent this issue.

To check if an employee still has an incorrect format stored in the system, create a data export using the following SQL query.

Select Security.Users.[User Number], Security.Users.[Preferred Date Format], Security.Users.[User Name] From Security.Users

If the employee does have a value against their user account, please raise a case with support for us to review.

If you are on version 3.3 or below, check that a user has the correct data format set against their account by following these steps.

  1. In the Admin Tool, click User Accounts.

  2. Click the user receiving the error message.

  3. Expand the User Interface tab.

  4. Make sure Use System Default is ticked against the date format.


Check Absence data

This error message can be generated when faulty data is being entered into the system.


For example, if an employee is on variable working pattern and they type in an incorrect start time (i.e. 008:00 instead of 08:00), the error message would be generated.

The erroneous data is likely to be the Start Date/Start Time of an absence, and will affect the employee who's absence history cannot be displayed.

The following query can be run against your SelectHR database to check:

Select Person.Snapshot.[Person Number], Person.Snapshot.[First Name], Person.Snapshot.Surname, Person.Snapshot.[Effective Status], Absence.History.[Absence Start Date], Absence.History.[Absence End Date], Absence.History.[Absence Type], Absence.History.[Start Time], Absence.History.[End Time], Absence.History.Workflow From Person.Snapshot Inner Join Absence.History On Person.Snapshot.[Person Number] = Absence.History.[Person Number] Where Person.Snapshot.[First Name] = 'REPLACEWITHFIRSTNAME' And Person.Snapshot.Surname = 'REPLACEWITHSURNAME' Order By Absence.History.[Absence Start Date]

Ensure to replace the First Name and Surname criteria for the employee with the first and surname of the impacted employee record so that you can check their start and end times for any erroneous entries.

If you find any start/end times that do not appear in a standard format (00:00), then you will need to edit the absence record via the absence history of the employee to correct each of the erroneous absences.

If this does not help, please raise a new case online and reference the title of this article, as we will need to make the amendments on your behalf.

Did this answer your question?