Forum Replies Created

Viewing 15 posts - 421 through 435 (of 1,241 total)

  • RE: Need to implement left join using look up

    komal145 (11/8/2016)


    Thank you. Merge join worked .

    Just a note, make sure the input streams are sorted in the same manner. I have seen where they were not and the data...

    ----------------------------------------------------

  • RE: SUM and Group using IN clause

    Assuming it is the 'Sick' hours that you are mainly focusing on , the following is as simple as I can code it:

    selectcid,

    sum(case when hr_type = 'sick' then 0...

    ----------------------------------------------------

  • RE: Query returning incorrect results randomly

    Are you querying everything from one table or doing some type of join(s)?

    ----------------------------------------------------

  • RE: Exporting Data

    Thanks Steve. Good straightforward question. I take it the capital Q means Quit (I'm not a sqlCmd user).

    ----------------------------------------------------

  • RE: Case Statement Update

    Koen Verbeeck (11/8/2016)


    Somehow completely missed that the data type was bit.

    Moar caffeine needed!

    Ok maybe the defaulting of the bit field to 'false' is a little "bit" tricky. Part of the...

    ----------------------------------------------------

  • RE: where condition on same column doesnt return data

    Ditto,

    First name can be 'John' OR 'Linda' but cannot be both at the same time (which is what a AND condition is implying).

    ----------------------------------------------------

  • RE: Is order important?

    I figured B, though I was struggling with D and was glad that the options were this or not this rather than figuring out the math on D 🙂

    ----------------------------------------------------

  • RE: Easy way to search for a string any where within XML column?

    This may not sound elegant, but a two step approach is to query out the entire xml string with the Results To File setting selected. Save the results to a...

    ----------------------------------------------------

  • RE: Easy way to search for a string any where within XML column?

    Tommy 70494 (11/2/2016)


    Thank you!

    it works, right out of the box.

    I don't know why I didn't think of this.

    I guess I got caught up in the fact that it was XML.

    The...

    ----------------------------------------------------

  • RE: Calculate Percent of Readmission

    Briceston (11/1/2016)


    Thank you for your insight. Your example was not exactly what i needed to answer my question, mainly due to a new Id is issued for a readmission. ...

    ----------------------------------------------------

  • RE: Easy way to search for a string any where within XML column?

    Does this help ?

    DECLARE @tbl TABLE

    (

    id INT,

    col XML

    )

    INSERT INTO @tbl

    VALUES

    (1,'<name><name1>aht</name1></name>'),(2,'<name>6</name>')

    select *

    from @tbl

    where col.value('(/name)[1]','varchar(10)')='aht'

    ----------------------------------------------------

  • RE: Case Statement Update

    Ed Wagner (11/1/2016)


    I had to read it twice because I was looking for the trick. Nice, straightforward question. Thanks.

    Thanks Ed. No tricks, though it is the day after...

    ----------------------------------------------------

  • RE: Calculate Percent of Readmission

    Below is a sample of the underlying data. Please excuse me if I did not use the correct code, and for the headers not being completely aligned.

    Reporting YearReg AreaOrignalAdmissionOrignalDischargeReadmissiondischargedatedays between...

    ----------------------------------------------------

  • RE: WHAT TO DO WHEN DBCC CHECKDB(REPAIR_ALLOW_DATA_LOSS) FAILS

    Hello, our server hard disk crashed due to power failure and all the backups were on the hard disk. Before just before it did we had managed to copy the...

    ----------------------------------------------------

  • RE: Accidentally Overwrote Stored Procedure

    Lynn Pettis (10/28/2016)


    Chris Wooding (10/27/2016)


    Just as an aside; I have got into the habit of using the "Script as create" instead of "Script as alter" or "Modify" options when looking...

    ----------------------------------------------------

Viewing 15 posts - 421 through 435 (of 1,241 total)