sql datetime转换为hql

时间:2012-02-08 12:56:21

标签: sql sql-server hql

我正在处理以下问题:

SELECT att.AttendenceCD, convert(varchar, att.AttDate, 101) AttDate, att.EmployeeCD
FROM Attendance att
where att.EmployeeCD = 2234 and att.AttDate = '11/02/2011'

如何将此查询转换为HQL?

1 个答案:

答案 0 :(得分:1)

检查一下。我希望它会起作用

SELECT att.AttendenceCD, convert(varchar(10), att.AttDate, 101) AttDate, att.EmployeeCD
FROM Attendance att
where att.EmployeeCD = 2234 and att.AttDate = '11/02/2011'

其他明智的

SELECT att.AttendenceCD, cast(att.AttDate, datetime(101)) AttDate, att.EmployeeCD
FROM Attendance att
where att.EmployeeCD = 2234 and att.AttDate = '11/02/2011'