Forum Replies Created

Viewing 15 posts - 3,436 through 3,450 (of 4,087 total)

  • RE: Date Range Parameters

    ALZDBA (12/9/2011)


    Keep in mind if your date columns are of datatype datetime don't use BETWEEN but use

    col >= @begin and col <= @end

    SQLServer has an issue with datetime data...

  • RE: Finding "sort of" duplicate records - multiple column aggregate??.. HELP

    There are several possibilities, but without sample data, it's difficult to determine which is best. Here are just two options.

    WITH DupeCheck AS (

    SELECT id, date, time, location, cardnumber, amount,...

  • RE: Date Range Parameters

    CELKO (12/9/2011)


    SELECT DISTINCT T.trans_id,

    @in_start_date AAS report_start_date

    @in_end_date AS report_end_date

    FROM Calendar AS...

  • RE: Problem with performance of Geospatial Query

    HowardW (12/9/2011)


    I did consider that. It's easy enough for stores being deleted, but I can't currently wrap my head around the logic to work out the sphere of influence for...

  • RE: Problem with performance of Geospatial Query

    HowardW (12/9/2011)


    All I'm trying to do is, with a list of stores (about 120) and a list of customers (about 2.3 million in real life) to assign each customer a...

  • RE: Date Range Parameters

    JonFox (12/8/2011)


    I think you may be trying to do something like this:

    WHERE (H.SALESSTTUS = 1 AND

    H.SALESORIGINID IN ('DSM','DSM-Trf') AND

    ...

  • RE: SSIS OLEDB Error

    There should be another error message before this one that will give you details about the exact error that occurred. Without that previous error message, we can't really tell...

  • RE: Return as single comma delimitted value

    Ninja's_RGR'us (12/7/2011)


    Cool, and the tested solution is? 😉

    I thought that the FOR XML PATH('') solution was probably not the best solution in this particular case, so I didn't test it....

  • RE: Return as single comma delimitted value

    Ninja's_RGR'us (12/7/2011)


    And the solution is??? Those are columns, not rows.

    I'll let you think about it for a couple minutes ;-).

    FOR XML PATH('') needs to be handle any data that...

  • RE: Error when displaying all the column names in one single column

    srik.kotte (12/7/2011)


    That is not possible actually.I have to do it in T-SQL :(. The requirement is like that.

    Why is that the requirement? Is this for a class?

    You want to...

  • RE: Error when displaying all the column names in one single column

    If you are planning to export these, you're better off doing this in SSIS rather than T-SQL. In SSIS, you can specify the delimiter and automatically include headers.

    Drew

  • RE: T-SQL help

    Here is a different approach using a CROSS APPLY.

    SELECT PetID

    , p.PetName

    , pd1.DDate AS Date1

    , pd2.Date2

    FROM @Pet AS p

    INNER JOIN @PetDetail AS pd1

    ON p.PetID=pd1.PetDetailID

    AND pd1.DType = 14

    CROSS APPLY (

    SELECT TOP (1)...

  • RE: Return as single comma delimitted value

    I prefer using FOR XML PATH(''), because it

    1) automatically handles the conversion

    2) automatically handles NULL values

    If you're working with character data, you do have to be careful with certain restricted...

  • RE: pivot table subtotal

    PIVOT is probably not the right tool for the job, because it doesn't provide grand totals. The correct tool depends on exactly how you are using this data. ...

  • RE: Modulo operator problem

    Cadavre (12/6/2011)


    For your own sanity, or that of whoever has to maintain this monster, try this instead: -

    I would go even further. For your own sanity, your whole data...

Viewing 15 posts - 3,436 through 3,450 (of 4,087 total)