0

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.

5
  • FROM VP_EMPLOYEE as EMPL, VP_PERSON as PRSN, - doesn't make sense Commented Jun 11, 2014 at 18:49
  • 2
    @SimchaKhabinsky why not? Commented Jun 11, 2014 at 18:50
  • @Kermit. Never mind - you're right that could make sense. Commented Jun 11, 2014 at 18:51
  • 1
    It would be nice to see the full SQL script. Commented Jun 11, 2014 at 18:52
  • What is the error message? Commented Jun 11, 2014 at 18:52

1 Answer 1

3

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
                                                   ^
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.