Forum Replies Created

Viewing 15 posts - 6,676 through 6,690 (of 10,144 total)

  • RE: Strange SQL Server Evaluation of 0 (bit) = '' (Empty string) or even non empty string

    andy.fensham (9/7/2011)


    ...

    I am fine with the implicit conversion...

    The implicit conversion of an empty string to a BIT datatype value 0 is still causing you some confusion - I'd suggest you're...

  • RE: Calculate component percents without a cursor

    gcresse (9/6/2011)


    ChrisM,

    This works fantastic with the test data! Thanks for your efforts. Now I will see if I can make it work with my actual tables.

    I had actually...

  • RE: joining 3 tables not getting valid resultset

    maruthipuligandla (9/6/2011)


    ...Any update on the query? ...

    Nope, still waiting for usable sample data scripts.

  • RE: Strange SQL Server Evaluation of 0 (bit) = '' (Empty string) or even non empty string

    steveb. (9/6/2011)


    ... an empty string does not equal NULL, to do this with your code you will need.

    SELECT CASE WHEN Cast(0 AS bit) = NULL THEN 1...

  • RE: joining 3 tables not getting valid resultset

    maruthipuligandla (9/6/2011)


    Hi,

    I've generated scripts with data for 4 tables, please find the attached sql script files..

    The image columns aren't required for this exercise, take up an inordinate amount of space,...

  • RE: joining 3 tables not getting valid resultset

    maruthipuligandla (9/6/2011)


    Hi,

    I didnt get what exactly you asking me for? Should i send scripts for 3 tables with data or what?...

    Four tables. If you take the time to read the...

  • RE: joining 3 tables not getting valid resultset

    maruthipuligandla (9/6/2011)


    Please find the sample data screen attached herewith from CandidateInterview table, where we can see the no:of candidates applied for a job for particular status..

    Please supply DDL and DML...

  • RE: Calculate component percents without a cursor

    Here's a mod which works across different products with different numbers of ingredients:

    USE tempdb

    GO

    CREATE TABLE Transactions(

    trnKey ...

  • RE: Select history of records

    kramaswamy (9/2/2011)


    just out of curiousity Chris, I assume there's no real difference between writing the query like that, or like "with ___ AS (blah) SELECT FROM cte WHERE count =...

  • RE: Calculate component percents without a cursor

    gcresse (9/1/2011)


    Oops. You are correct, I have a mistake in the spreadsheet calculations.

    I forgot to mention in my original post that the product is liquid and stored in...

  • RE: Issue with Join ...

    mattech06 (9/1/2011)


    Thanks guys for the speedy response. I actually used something similar using WHERE instead and it's returned the same amount of rows. However both WHERE and INNER JOIN seems...

  • RE: Issue with Join ...

    Here's the simplest most basic script which makes a lot of assumptions:

    SELECT

    p.dbPatCnt,

    p.dbPatFirstName,

    p.dbPatLastName,

    f.dbPhoneNumber,

    f.dbPhoneTypeID

    FROM Patients p

    INNER JOIN LnkPhone l ON l.dbKeyCnt = p.dbPatCnt

    INNER JOIN Phone f ON...

  • RE: How to join a table-valued Function

    lalit.madan (7/19/2011)


    /*this behaves like inner join*/

    select * from freight_manager

    cross apply LargeOrderShippers ( freight_manager.min_value, freight_manager.max_value)

    /*this behaves like cross join*/

    select * from freight_manager

    outer apply LargeOrderShippers ( freight_manager.min_value, freight_manager.max_value)

    🙂

    I think you will find...

  • RE: Select history of records

    Here's another way:

    SELECT

    question,

    Answer,

    answereddate,

    accredappid

    FROM (

    SELECT

    question,

    Answer,

    answereddate,

    accredappid,

    AnswerCount = COUNT(*) OVER (PARTITION BY accredappid, question)

    FROM answers

    ) d

    WHERE AnswerCount > 1

    ORDER BY accredappid, question

  • RE: Calculate component percents without a cursor

    The calculations in your spreadsheet appear to be incorrect, this is what I think it should look like:

    [font="Courier New"]

    Ingr Pct Ingr...

Viewing 15 posts - 6,676 through 6,690 (of 10,144 total)