SQL Syntax error using the CAST function

  • Hi All

    I have an SQL that I'm having problems using the CAST function. Below is part of the SQL program:

    SUM(B.Billing_Time) AS Incident_Bill,

    SUM(B.Absorbed_Time) AS Incident_Abs,

    SUM(B.Actual_Time) AS Incident_Actual,

    SUM(E.Billing_time) AS Solmon_Bill

    CAST(SUM(D.Billing_Time)AS decimal(8,2)) As Task_Bill

    SUM(D.Absorbed_Time) as Task_Abs

    Thanks for any help on this issue. The data is stored as "float" and I'd like it to be displayed in 2 decimal places

  • Hi, I think you are trying to sum the BILLING_TIME intead of billing amount.

    If it is a FLOAT value, you should not have problem to CAST it.

    Thanks.

  • It's SQL Syntax error not using the CAST function but SQL Syntax error NEAR the CAST function.

    Would you mind to check commas in your statement?

    _____________
    Code for TallyGenerator

  • oh yeah, there is a comma missing after Solmon_Bill.

  • Not only

    _____________
    Code for TallyGenerator

  • Thank you all. This list is great!

    Bill

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply