Forum Replies Created

Viewing 15 posts - 1,081 through 1,095 (of 3,500 total)

  • RE: How to insert multiple records from fields in select record

    Using the above Cross Apply where we have 3 rows coming back, is there a way to tell it to only send only one row instead of three based on...

  • RE: Simple question on multiple INNER JOINs

    Is this an Access question or a SQL Server question? I'm asking because SQL Server uses single quotes to delimit text strings and Access uses double quotes. If you're writing...

  • RE: Sort already comma separated list

    (Shows how much I understand about FOR XML... is there a good book on the bare necessities you need to understand about XML in SQL Server?)

  • RE: How to retrieve rows that as been deleted from the result of a DM view

    But you could create a table and write the values from the DMV into it... Then you could look at it over time. Not sure it's worth doing, but that's...

  • RE: Sort already comma separated list

    Use a TVF like DelimitedSplit8K to break out the pieces, sort them then reassemble using STUFF.

  • RE: How to insert multiple records from fields in select record

    step 1: find all the names that are not null 
    step 2: union them together.
    insert the result from step 2 into your final table.
    return results from final table....

  • RE: Calculate daily meeting times for each employee

    How about
    CREATE TABLE Meeting (
        MeetingID INT IDENTITY PRIMARY KEY,
        MeetingType VARCHAR(20) NOT NULL,
        StartDateTime DATETIME,
        EndDateTime DATETIME...)

    And then...

  • RE: Calculate daily meeting times for each employee

    A little normalization goes a long way. If a single record describes ONE meeting, then this is trivial.

  • RE: Query Question

    Oh, right... funny, I totally forgot about Kenneth Fisher's example of using CROSS APPLY to unpivot. (See me still thinking in terms of Access??!! BLECH!!)

  • RE: Query Question

    One way of doing it is like this:
    (this is a sample bad table)
    CREATE TABLE DiagnosesBad (
        PatientID INT NOT NULL,
        Cycle TINYINT NOT NULL,
        Diagnosis9_1 VARCHAR(20),

  • RE: Query Question

    dougsto - Monday, January 28, 2019 2:04 PM

    Unfortunately, I cannot make changes to the database. We did not develop it.

    You might have...

  • RE: Query Question

    Yes, it does.
    SELECT  dbo.mdhomadm.Patient_Number, dbo.mdhomadm.Diagnosis9_1, dbo.mdhomadm.Diagnosis9_2, dbo.mdhomadm.Diagnosis9_3, dbo.mdhomadm.Diagnosis9_4, dbo.mdhomadm.Diagnosis9_5,
       dbo.mdhomadm.Diagnosis9_6, dbo.mdhomadm.Diagnosis9_7, dbo.mdhomadm.Diagnosis9_8, dbo.mdhomadm.Diagnosis9_9, dbo.mdicdcde.ICD_Code_Description
    FROM  dbo.mdhomadm LEFT OUTER JOIN
       dbo.mdicdcde ON dbo.mdhomadm.Diagnosis9_1 = dbo.mdicdcde.ICD_Code

    The problem is...

  • RE: Query Question

    dougsto - Monday, January 28, 2019 1:43 PM

    I have a table that contains multiple fields:
    Diagnosis1
    Diagnosis2
    Diagnosis3
    Diagnosis4
    Diagnosis5
    Diagnosis6
    Diagnosis7
    Diagnosis8
    Diagnosis9
    each field only contain codes, the descriptions are...

  • RE: trying to learn SQL development

    Grant Fritchey - Monday, January 28, 2019 9:15 AM

    Glad to hear the book was useful. Thank you!

    In that case, hit the stairways...

  • RE: How sql query use in Pivot table ?

    akhterhussain80 - Friday, January 25, 2019 7:52 PM

    SELECT  EmpID, ReportingDate, CASE WHEN [Days] IS null AND EXISTS         (SELECT ...

Viewing 15 posts - 1,081 through 1,095 (of 3,500 total)