Forum Replies Created

Viewing 15 posts - 3,661 through 3,675 (of 10,143 total)

  • RE: Multiples address lines on a single row. Pivot?

    Edit: completely misunderstood the question. Where's the coffee?

  • RE: Returning multiple records when only one is specified

    Can't you ask your boss?

    The reason I'm asking is because - if (s)he isn't aware that your script can't be shaped into a view, (s)he probably isn't aware that...

  • RE: Help with date in sQL

    dhananjay.nagarkar (2/4/2014)


    I have date field named "[Latest Filled Date]" - format smalltimedate.

    I'm trying to do-If the "[Latest Filled Date]" equals the previous weeks Monday - Saturday dates...

  • RE: Returning multiple records when only one is specified

    crazy_new (2/5/2014)


    My boss wants this script as a view, and I told him you cant put this in a view, just wanted to make sure im right.

    Thanks for your help...

  • RE: First and last records by reference number

    Another way:

    ,row_number() over (

    partition by AD.UnitNumber,AD.AccountNumber order by AD.VisitID) as [Index]

    ,COUNT(*) over (partition by AD.UnitNumber,AD.AccountNumber) as [MaxIndex]

    filter on [Index] = 1 OR [Index] = [MaxIndex]

  • RE: Returning multiple records when only one is specified

    What's going to consume the result set from the view? How will it handle an unknown number of columns with some unknown names? Can't you concatenate the variable address elements...

  • RE: Exclude NULL values from select statement

    Nice work, Helmi. The best possible outcome here is when the OP - that's you - figures out the problem themselves given a few pointers.

    You may wish to examine your...

  • RE: UNABLE TO RETRIEVE data while using between operator

    The BETWEEN range ends at 'V'. If you have a vendor with exactly this value then it will be included. Vendors called 'V' + anything else will be excluded because...

  • RE: Exclude NULL values from select statement

    Eliminating rows with a null value could play havoc with your [Status] values. Try this to see what I mean:

    selectdistinct

    ph.ProdHeaderOrdNr,

    ph.PartCode,

    ph.[Description],

    ph.Qty,

    [Status] = (

    select max(psl.ProdStatusCode)

    from ProdStatusLog psl

    where psl.ProdHeaderDossierCode = ph.ProdHeaderDossierCode),

    [Uitgifte] =...

  • RE: Exclude NULL values from select statement

    Here's your query rewritten to replace old-style joins and with table aliases to reduce noise:

    selectdistinct

    ph.ProdHeaderOrdNr,

    ph.PartCode,

    ph.[Description],

    ph.Qty,

    [Status] = (

    select max(psl.ProdStatusCode)

    from ProdStatusLog psl

    where psl.ProdHeaderDossierCode = ph.ProdHeaderDossierCode),

    [Uitgifte] = (

    select max(psl.LastUpdatedOn)

    from ProdStatusLog psl

    where psl.ProdHeaderDossierCode...

  • RE: Are the posted questions getting worse?

    L' Eomot Inversé (2/4/2014)


    Grant Fritchey (2/3/2014)


    Please, please, please, no piling on, but I'm curious what you guys think about this: Unreasonable Defaults. I think most of the fundamental info is...

  • RE: Remove special characters from String

    sql_ques (2/4/2014)


    The datatype of column is ntext

    Ouch! I remember those...

  • RE: Remove special characters from String

    sql_ques (2/4/2014)


    This worked 🙂

    REPLACE(CAST(ColumnName AS nvarchar(max)),';#','' )AS [Type]

    What datatype is the input column? Remove the CAST, it's unnecessary overhead.

  • RE: Get list of all workers having same SET of Rates

    Here's a pure TSQL method to compare with Lowell's string-concatenation method.

    ;WITH Rates AS (SELECT worker_id, rate_code, rate_count = COUNT(*) OVER(PARTITION BY worker_id)

    FROM #worker_rate r)

    SELECT

    rate_group = DENSE_RANK() OVER(ORDER BY...

  • RE: exec proce

    elham_azizi_62 (2/3/2014)


    I am in hurry and I don't have time and I have to give it to my boss immediately.please help me.

    Something so timecritical should not be subject to the...

Viewing 15 posts - 3,661 through 3,675 (of 10,143 total)