当我尝试在t-sql中执行此查询时,我收到了错误的语法错误。我很感激任何帮助 - 我相信问题已经存在,或者在ROUND声明中。
SELECT
EMPL.employeeid as KEmplID,
EMPL.PERSONNUM as EmployeeNumber,
EMPL.PERSONFULLNAME as FullName,
....
FROM
VP_EMPLOYEE as EMPL,
VP_PERSON as PRSN,
(
SELECT
TLS.employeeid as EMPLID,
TLS.applydate as APPLYDATE,
ROUND((SUM(CONVERT(FLOAT,TLS.timeinseconds)) /60/60,1)) AS ElapsedHrs
FROM
VP_TOTALS as TLS,
VP_PAYCODE as PAYCODE
....
我只是不太确定我的问题出在哪里 - 再次,我认为这是圆形陈述,但我可能是错的。我将非常感谢所有帮助或建议,以提高效率或帮助进行数据的舍入,转换和求和。
答案 0 :(得分:3)
不正确:
ROUND((SUM(CONVERT(FLOAT,TLS.timeinseconds)) /60/60,1)) AS ElapsedHrs
更正(括号放置):
ROUND((SUM(CONVERT(FLOAT,TLS.timeinseconds)) /60/60),1) AS ElapsedHrs
^