Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The data types time and datetime are incompatible in the greater than or equal to operator

I have an application using EclipseLink and SQL Server.

When I execute the below JPQL query on a column of SQL Server type Time:

VisitMasterTable.bookingTime between '08:00:00' and '08:59:00'

then I get below error:

The data types time and datetime are incompatible in the greater than or equal to operator.

How is this caused and how can I solve it?


1 Answers

You need to add sendTimeAsDateTime=f‌​a‌​lse to your connection string like:

jdbc:sqlserver://localhost:1433;databaseName=<db_name>;sendTimeAsDateTime=f‌​a‌​lse
like image 186
Bahadir Tasdemir Avatar answered Oct 31 '25 06:10

Bahadir Tasdemir