2012-02-08 78 views
0

我的工作在以下查询:SQL日期时间转换为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

检查此。我希望它会工作

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' 
+0

非常感谢你。 – Almaji 2013-02-10 07:27:18