Forum Replies Created

Viewing 15 posts - 3,526 through 3,540 (of 4,087 total)

  • RE: Date manipulation and pivottable in excel

    It wasn't chastisement, it's realism. You have to understand that everyone here is a volunteer. The more hurdles you place in front of people, the fewer will even...

  • RE: Date manipulation and pivottable in excel

    First, the idea behind including a SAMPLE is that it is large enough to provide a realistic representation of the data, BUT NO LARGER. Since you are grouping on...

  • RE: case statement help.

    bass8117 (10/27/2011)


    below is part of code that includes many subselects, sums, etc. here's the problem I have,

    in the CHRG0.CHRG_AMT column I have a reverse charge of -289.00 with a CHRG0.CHRG_BAL...

  • RE: Select top five rows for each key value

    Actually, I didn't read your query closely enough. I didn't see that you were using a subquery.

    The two approaches are equivalent and will give the exact same execution...

  • RE: Help needed getting summary by weeks of current month

    Here is a fairly simple way to get what you're looking for.

    SELECT Year(ms.MonthStart), Datename(Month, MonthStart), WeekOfMonth, Sum(YourAmountField)

    FROM YourTable AS l

    CROSS APPLY ( SELECT DateAdd(Month, DateDiff(Month, 0, GetDate()), 0) AS MonthStart...

  • RE: Retrieving status from history

    Depending on your indices and your data, the following may be more efficient.

    SELECT

    o.OrderID,

    ...

  • RE: Select top five rows for each key value

    pschwartzbauer (10/26/2011)


    Can you use the RANK() function? Something like...

    SELECT A.Key, A.Date, A.Status, A.Ranking

    FROM (SELECT Key, Date, Status

    , RANK() OVER(PARTITION BY Key ORDER BY Date DESC) AS Ranking

    FROM table) A

    WHERE A.Ranking...

  • RE: Ado recordset does not return value from varchar(MAX) field

    TEXT is being deprecated. Use varchar(max) instead.

    Drew

  • RE: Left Command Troubles with NULL Values

    Ninja's_RGR'us (10/25/2011)


    Try LEFT(middlename + '.', 1) instead.

    That'll work depending on your concat_null_yields_null setting.

    You really should test before posting. I think what you wanted was actually

    ISNULL(LEFT(middlename, 1) + '.', '')

    This...

  • RE: index on big table

    dva2007 (10/25/2011)


    It doesnt have any unique key and the uniqey key is 70 character long.

    If it doesn't have a unique key, how are you able to determine it's length?

    If your...

  • RE: Inserting a HTML Link Within the Cell of a Table in SQL Mail

    mpartridge (10/20/2011)


    The problem we have is with this line:

    td = '<a href="mailto:abc@xyz.com?Subject=Mailto%20Test&cc=xyz@abc.com">mailto:abc@xyz.com</a>', ''

    SQL will not recognise that as a HTML link and pastes the whole thing into a table cell,...

  • RE: How do I consolidate multiple rows into 1 row of output

    The typical way to do this is with FOR XML PATH. Most examples will also use a stuff to remove an initial extraneous delimiter, but I didn't include that...

  • RE: Passing a Var to SP that needs B-up and

    Sean Lange (10/19/2011)


    Sure.

    declare @Codes varchar(25) = '14, 8, 21458'

    ;with cte(n) as (select 1

    union all select 14

    union all select 214

    union all select 314

    union all select 15

    union all select 8)

    select *

    from...

  • RE: Passing a Var to SP that needs B-up and

    toddasd (10/19/2011)


    Here is a second option. Will not be as performant as the splitter option.

    Declare @Type_Code varchar(50)

    set @Type_Code = '4,11,12'

    Select * from table_Type_Codes Where @Type_Code like '%' + table_Type_Codes...

  • RE: Join using Charindex -- there's got to be a better way?

    I would use LIKE instead. You'll probably still have to do an Index Scan (assuming that column is indexed on your claim table), but that will probably save you...

Viewing 15 posts - 3,526 through 3,540 (of 4,087 total)