user3731369
user3731369

Reputation: 11

SQL Syntax Error

I'm getting an incorrect syntax error when I try to execute this query in t-sql. I'd appreciate any help - I believe the issue is on, or around the ROUND statement.

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



....

I am just not quite sure where my issue stems - again, I think it is the round statement but I could be wrong. I will appreciate any and all help - or suggestions - to make this more efficient or help with the rounding, conversion and sum of the data.

Upvotes: 0

Views: 46

Answers (1)

Steven
Steven

Reputation: 13769

Incorrect:

ROUND((SUM(CONVERT(FLOAT,TLS.timeinseconds)) /60/60,1)) AS ElapsedHrs

Corrected (parenthesis placement):

ROUND((SUM(CONVERT(FLOAT,TLS.timeinseconds)) /60/60),1) AS ElapsedHrs
                                                   ^

Upvotes: 3

Related Questions