我有一个使用 EclipseLink 和 SQL Server 的应用程序。
当我对 SQL Server 类型的列执行以下 JPQL 查询时 Time
:
VisitMasterTable.bookingTime between '08:00:00' and '08:59:00'
然后我得到以下错误:
The data types
time
anddatetime
are incompatible in the greater than or equal to operator.
这是怎么引起的,我该如何解决?
最佳答案
您需要添加 sendTimeAsDateTime=false
到您的连接字符串,如:
jdbc:sqlserver://localhost:1433;databaseName=<db_name>;sendTimeAsDateTime=false
关于sql-server - 数据类型 time 和 datetime 在大于或等于运算符中不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38954422/