Forum Replies Created

Viewing 15 posts - 3,346 through 3,360 (of 4,085 total)

  • RE: how to group my results

    aitchkcandoo (1/20/2012)


    Drew, I read what you said about starting a new thread. With deference to your seniority on this forum, may I disagree? I think it is good to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Compute table column based on other columns by month

    CELKO (1/20/2012)


    I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: displaying x y into 5x5 result set

    kevmck (1/20/2012)


    While I appreciate the advise, the page you linked really didn't tell me a whole lot, except give me the indication that I'd be using a sledgehammer to kill...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Is there an accurate script for datediff format in years:months:days?

    Fahey's logic above is what I used in coding my response, since that is how ages are typically calculated and age was specifically mentioned.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to group my results

    aitchkcandoo (1/20/2012)


    will you please be explicit? The subquery alone doesn't work:

    select fname

    ,lname

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: displaying x y into 5x5 result set

    I think that part of the problem is your database design. It sounds like your problem should be implemented using the geometry data type which has methods specifically to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Shredding XML using XQuery

    You just use a CROSS APPLY and replace the variable name with the column name.

    SELECT *

    FROM YourTable

    CROSS APPLY (

    SELECT c.value('b[1]', 'varchar(10)'), c.value('c[1]',...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: dynamic column list building is giving problem

    I think the actual problem is the PRINT command. PRINT will only show a certain number of characters (I forget the number) and it sounds like you may have...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to group my results

    This should work.

    select fname

    ,lname

    ,ssn

    from ( select fname

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Shredding XML using XQuery

    Your XML is mal-formed. XQuery requires a single root element, which yours doesn't have and the end tag for your <C> element doesn't match. I've corrected the XML.

    DECLARE...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Is there an accurate script for datediff format in years:months:days?

    Lowell (1/17/2012)


    i have tehse saved in my snippets; does this do what you want?

    --elapsed time/datediff

    select [Years] = datediff(year,0,ET-ST)-1,

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Is there an accurate script for datediff format in years:months:days?

    I think this will give you what you are looking for. It depends on the fact that the variables are set in left to right order. You can...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Unique key

    Sean Lange (1/18/2012)


    I would ask though why do you need more than 1 column that is unique? The point of a unique index is to allow you to identify any...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Basic Create Foreign Key Issue

    You have a value for BID in your C table that doesn't have a corresponding value for BID in your B table. The best way to resolve this is...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Returning a column per date in a range

    SQL Kiwi (1/12/2012)


    What is exactly your point?

    My point is that it's not only possible, but extremely likely to read your comments as recommending using an rCTE for new development for...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,346 through 3,360 (of 4,085 total)