Forum Replies Created

Viewing 15 posts - 3,691 through 3,705 (of 4,085 total)

  • RE: hi

    Abhijit More (6/29/2011)


    Use UNPIVOT operator.

    The UNPIVOT operator doesn't work well when you want to unpivot multiple sets of data. Here the OP wants to unpivot three sets of data:...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Formatting a date to YYYYMMDD

    repicurus (6/27/2011)


    select replace(convert(char(10), getdate(), 120), '-', '')

    How is this an improvement over the code listed below that the OP is already using?

    select convert(varchar,getdate(),112)

    I can't imagine that the efficiency of converting...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to Avoid the intervals

    thava (6/27/2011)


    hope fully this is not a clean one but now it satisfies my condition so any one simplify it

    This is a variation of the overlapping date ranges problem. ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Cartesian product sql query

    Selahattin SADOGLU (6/24/2011)


    insert into #Personel values('deneme1'),('deneme2'),('deneme3')

    insert into #Masa values('Masa1'),('masa2'),('masa3')

    This syntax was introduced in SQL 2008. Since you're posting in the SQL 2005 forum and you're getting error messages about...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Reverse arguments in an IN statement?

    Actually what you are looking for is IN itself. There's nothing that requires the left side to be a field and nothing that prevents the right side from being...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: counting records and summing money amount

    Both WITH CUBE and WITH ROLLUP require that you have a GROUP BY clause, which I don't think that you want to use in this case. The COMPUTE clause...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Unfamiliar Date format not recognized by ISDATE()

    One caveat is that in SQL 2008, it automatically takes DST into account, so you'll need to make sure that your UDF also takes that into account.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Unfamiliar Date format not recognized by ISDATE()

    This is datetimeoffset data. It was introduced in SQL2008. It combines datetime data with a time zone offset.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Problem with year break between birthdate query

    Jeff Moden has previously posted about how inefficient it is to convert datetime data to varchar. His most recent post is here http://www.sqlservercentral.com/Forums/FindPost1119797.aspx.

    There is a solution that only uses...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Issue with NULL or some white space character

    T-SQL does not use the ASCII null character to represent a NULL string. As far as SQL is concerned, there is no difference between ASCII 0 and any other...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: get minutes from datetime with leading zero

    Andrew Westgarth (6/21/2011)


    I didn't need to do this for presentation it was for comparison against a varchar field. Basically I have a user input varchar of time e.g. 02:32:53...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: get minutes from datetime with leading zero

    You probably shouldn't be doing this in T-SQL at all. This is a presentation issue and should be left to the presentation layer.

    What are you ultimately trying to achieve?...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: batch insert question- One Transaction?

    This sounds suspiciously like a homework assignment. Why don't you tell us your thoughts?

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to Left Justify Results

    Jnrstevej (6/21/2011)


    I'm under the impression that if i could get the column(item) to align to the LEFT in the select statement when its exported this should in theory solve my...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to Left Justify Results

    Justification is a presentation issue and T-SQL is not designed to be a presentation layer, so it has no support for presentation, although you can use string manipulation functions to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,691 through 3,705 (of 4,085 total)