数据类型time和datetime在大于或等于运算符时是不兼容的

时间:2022-09-18 13:09:52

I have an application using EclipseLink and SQL Server.

我有一个使用EclipseLink和SQL Server的应用程序。

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

当我在SQL Server type Time的列上执行下面的JPQL查询时:

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 个解决方案

#1


4  

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

您需要添加sendTimeAsDateTime = f‌‌证交所你的连接字符串:

jdbc:sqlserver://localhost:1433;databaseName=<db_name>;sendTimeAsDateTime=f‌​a‌​lse

#1


4  

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

您需要添加sendTimeAsDateTime = f‌‌证交所你的连接字符串:

jdbc:sqlserver://localhost:1433;databaseName=<db_name>;sendTimeAsDateTime=f‌​a‌​lse