Forum Replies Created

Viewing 15 posts - 25,456 through 25,470 (of 26,487 total)

  • RE: Need help in adding Percentage column

    Actually, Matt, I was agreeing with you on your comment.

  • RE: Need help in adding Percentage column

    Just giving to OP what was requested.  I'd prefer this for the percentage column:

    cast((Total/GrandTotal) * 100 as decimal(5,2)) as Percent

    😎

  • RE: Need help in adding Percentage column

    Try this:

    ;with TotalAmt (

        GrandTotal

    ) as (

    select

        sum(Total)

    from

        dbo.yourView

    )

    select

        RegionDesc,

        MATotal,

        PartsTotal,

        DemandTotal,

        Total,

        cast(( GrandTotal/ Total) as decimal(5,2)) as Percent

    from

        dbo.yourView

        cross join TotalAmt

    😎

  • RE: Need help in adding Percentage column

    Could you be more specific?  Please show us how this calculation should be done using the data you provided in your original post.

    😎

  • RE: master..xp_fileexist, Limited?

    Is the servername correct in your example using an UNC?  I just tried it on one of my servers and it works fine going down several directories.

  • RE: Stored procedure slower then query

    Without seeing the code for the stored procedure, it is a guess.  It could be parameter sniffing at work.  Are you using the variables declared in the header of the...

  • RE: SSIS package scheduled and running from SQL Agent mysteriously stops scheduled execution.

    Is the schedule still enabled?  it almost sounds like the schedule had an end date set so that it would not run after a specified date.

    😎

  • RE: Help with a MAX score issue

    Try this:

    SELECT

        t.schoolc as School_Code,

        RTRIM(k.schname) as School,

        s.ident as Ident,

        RTRIM(s.lastname) + ', ' + RTRIM(s.firstname) AS Student,

        ss.graden as [Current Grade],

        left(sb.descript,20) as Subject,

        max(sc.testscore) as Score

    FROM...

  • RE: Rename file using timestamp

    I use a Script Task to format the date for creating an archive subdirectory using a datestamp.  You can use the same mechanism to format the datetime stamp for...

  • RE: What Could Go Wrong?

    Perhaps you'd like to explain the lack of large pices in the crash of flight 585 (hope I have the right flight number) that crashed in park less than 2...

  • RE: What Could Go Wrong?

    As I said, go on believing what you want, based on everything I have seen and read, I don't believe anything that you have espoused is true.

  • RE: What Could Go Wrong?

    Johan,

    Go on believing what you want.  I have seen and read enough to know what you are espousing is untrue.

     

  • RE: SLOW Update

    How many recrods are in #report when you run this update?  Also, how many records in TableA and TableB?  How are TableA and TableB indexed?

  • RE: find data type of a field in a select

    Based on what I have read, I think the answer to your question about there being a function that will return the datatype of an input; a table column in...

  • RE: What Could Go Wrong?

    Don't confuse writing editorials with reporting of news events.  Editorials are a journalists opinion based on what ever facts they may (or may not) have found while researching a topic. ...

Viewing 15 posts - 25,456 through 25,470 (of 26,487 total)