Forum Replies Created

Viewing 15 posts - 4,066 through 4,080 (of 5,502 total)

  • RE: Pivot with Variable Assignment

    Instead of using the SUM() function on varchar values you'd need to use MAX().

    Something like:

    select

    @Zip1 = max(Case When Rank = 1 Then Zip End),

    @Zip2 = max(Case When Rank =...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How do I show items dated 1 day from current date?

    Grey Cat (3/5/2010)


    Does this work?

    select * from table where functionDate > convert(date,GETDATE()+1)

    It depends.

    I asked before: what is the data type of functionDate?

    You stated it would be datetime, but that doesn't...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: PIVOT CASE QUERY Help

    There is still no sample data available that would make it possible to create your expected output: COMPLETE(TRAIN) CANCELLED(TRAIN) COMPLETE(BUS) CANCELLED(BUS)

    Let's start from the very beginning:

    Please show us the data...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: PIVOT CASE QUERY Help

    Unfortunately, we don't have any sample data :unsure:

    Please use the INSERT INTO @tbl and add some sample data rather thana join to tables we don't have access to.

    Also, you...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How do i select the top1 column from a table in a select statement which contains multiple columns from multiple columns

    Welsh Corgi (3/5/2010)


    Thank you Lutz, please accept my apology for not asking for complete information...

    No reason to apologize. That's what a forum is all about: to have more than just...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Arithmetic overflow error converting float to data type numeric

    apat (3/5/2010)


    Yes, this works... Thanks a lot everyone...

    One more point,

    I also would like to do the opposite for power function as well...

    Instead of ---- ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Arithmetic overflow error converting float to data type numeric

    Are you really sure you want to calculate 1.8 ^975.81???

    Not even sure, what that number will be....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: how can i check whether role is working or not

    What user did you use to try the insert?

    Your revoke statement will remove any previously given permission:

    Straight from BOL:

    Removes a previously granted or denied permission.

    I guess what you're looking...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: PIVOT CASE QUERY Help

    Would you please modify your sample data to include some sample data for your new columns?

    Also please clarify whether the data you'd like to PIVOT will be static (e.g. there...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Concatenate column rows into one row with a group by

    You could use the FOR XML PATH approach and a subquery (or CTE):

    DECLARE @tbl TABLE

    (

    grp INT,ledger CHAR(3), amount INT

    )

    INSERT INTO @tbl

    SELECT 1 ,'A01', 5 UNION ALL

    SELECT 1 ,'A02', 3 UNION...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How to use"Union ALL" to join sql queries each containing order by clause

    I just needed to show that your statement

    u have to ensure that the aliases of everything your selecting must match between the top select and bottom select

    is just wrong. Nothing...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How to use"Union ALL" to join sql queries each containing order by clause

    BaldingLoopMan (3/4/2010)


    also u have to ensure that the aliases of everything your selecting must match between the top select and bottom select. these aliases is what you will put in...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How do I show items dated 1 day from current date?

    There are some confusing statements in your epost:

    "fieldname of datetime datatype" vs. "daily date entries; just dates, no time"

    That's simply impossible. Either you have a DATE datatype (assuming you're...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Preventing data modification depending on other data state

    cowabunga (3/4/2010)


    Would it be possible to use views that will exclude the rows/columns they're not allowed to change and grant update permission to that view?

    Not so simple !

    They are allowed...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How do i select the top1 column from a table in a select statement which contains multiple columns from multiple columns

    In addition to the data WC asked for, you should provide the column we need to order the values. Otherwise the TOP statement won't make that much sense...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 4,066 through 4,080 (of 5,502 total)