Forum Replies Created

Viewing 15 posts - 76 through 90 (of 217 total)

  • RE: get a percentage

    SELECT (col1 * 1.0/col2 * 100) AS percentage FROM table1

    why do you have to multiply one column by 1.0 and the other by 100?

    Thanks!

  • RE: left join causing results to be multiplied.

    Someone on usenet suggest this...I think it may work?

    One way would be to turn your "workexpense" table into a derived

    table:

    select users.Uname, users.UnameFirst, users.UnameLast,

    round(sum(workcompleted.WCmileage), 2) as totMileage,

    round(sum(workexpense.WXamount), 2) as totExpenses

    from workrequest,...

  • RE: Query...combine results of one column

    I have this query(below) that returns the type of format I want, but these results are wrong. I am not sure how to combine the two queries to get...

  • RE: Query...combine results of one column

    yeah like staying up til 5am looking at the screen until your eyes feel like they are going to fall out.

  • RE: Query...combine results of one column

    No need to be sorry. I have BOL and I've been using it for over a year now. It's a wonderful resource. But I've tried all sorts...

  • RE: JOIN screwing things up.

    Yeah, this is getting confusing

    I tried this, but it said Line 14: Incorrect syntax near '('.

    I looked over and over the statement, but...

  • RE: JOIN screwing things up.

    Thanks! That works on my parred down query, but when I try to implement it on my real query, I get this error:

    Invalid column name 'WXamount'

    Here is the full...

  • RE: JOIN screwing things up.

    wow that generated over 46,000 rows! It should only be 20 or so. I am not sure why it...

  • RE: JOIN screwing things up.

    Here is a simplified query that returns the mileage and WCid(for reference).

    If I take out the LEFT OUTER JOIN, the query returns the correct #'s. But I need that...

  • RE: JOIN screwing things up.

    Thanks for your responses.

    The workexpense table does not actually contain any mileage data. It just contains data that I need for the totExpenses column. All my mileage data,...

  • RE: I ruined my query

    Hey Gopi! That worked! What did you do? I don't understand your logic behind the change.

    But thanks!

  • RE: I ruined my query

    Data will be in the TotOpen column if PayDay is Null or WRcurrentStatus is not 110.

    (NOTE: PayDay is the result of a subquery)

    Data will be in TotVoid column...

  • RE: Row Size is too large?

    Sergiy, if I remove the entire GROUP BY, I still get this error:

    Column 'requestgenerator.RGnameLast' is invalid in the select list because it is not contained in an aggregate function and...

  • RE: Row Size is too large?

    But if I take WRnotes out of the GROUP BY I get the infamous error:

    [Microsoft][ODBC SQL Server Driver][SQL Server]Column 'workrequest.WRnotes' is invalid in the select list because it is not...

  • RE: Row Size is too large?

    Sergiy, I should of said I did try that too. I've also tried using CAST instead of CONVERT. I have examined my query over and over and do...

Viewing 15 posts - 76 through 90 (of 217 total)