Forum Replies Created

Viewing 15 posts - 1 through 15 (of 21 total)

  • RE: How can I write this query?

    OK, that was easier than I was making it. Thank you Drew, I used your solution.
    -martin

  • RE: How to write this query?

    Thank you sir, your explanation made me understand it perfectly. I added one more join for a 10K limit which should be enough.
    -martin

  • RE: How to write this query?

    Thanks everybody!
    I ended up using the response by Mr. Jacob Wilkins.
    There is something I'm not understanding though: The cte that is called 'n', why is it just a...

  • RE: Is this query possible?

    I apologize for the sheistiness... I did indeed edit the OP because I had a couple of the values incorrect. The [interval_prime field] should indicate the first interval of the...

  • RE: is this query possible?

    thank you, that's pretty clever. I was close, but probably would not have gotten the answer on my own. and I'm actually working in oracle on this specific query, but...

  • RE: Help with SQL Query

    Thank you very much for your efforts, I learned a new thing today.

    I'm still trying to wrap my head around the join that you did. Very clever...

    Now it will...

  • RE: Help with SQL Query

    Hi Steve, thanks for your response.

    This is totally a work problem, the example I provided is a very simplified version of our actual data. To give you the background: I...

  • RE: dynamic pivot troubles :/

    Steve, one more question. I'm able to use your last solution, but how can I turn the NULLs into Zeros? I tried a few things that didn't work.

  • RE: dynamic pivot troubles :/

    Thanks for your interest Steve. The reason I changed date to datetime is because I'm actually using SSMS 2005 (sorry I posted in the 2008 section for increased readership).

    how can...

  • RE: dynamic pivot troubles :/

    Luis,

    Thanks for your help.

    Changing the datatype to (max) in both places helped. Now I get the correct crosstab columns and rows, but the data part is completely blank.

    I had to...

  • RE: dynamic pivot troubles :/

    Steve,

    I tried your code. I had to change it slightly, so I changed the query to:

    DECLARE @SQL AS varchar(max), @DATES AS varchar(max)

    set @sql = ''

    set @dates = ''

    SELECT @DATES...

  • RE: dynamic pivot troubles :/

    Luis, thank you very much, I was able to adapt your query to fit my needs!

    The only issue now is that the 4000 limit ends up cutting off the...

  • RE: Crosstab, dynamic number of columns, No Pivot function!

    thanks for the replies.

    erin,

    the reason i need to avoid th pivot function is because i'm using an older version that doesn't have it.

    howard,

    the name of the columns should be the...

  • RE: trouble with CASE statement

    i got it guys, the answer for those searching later is:

    and

    (

    [FIELD] = case

    when @var = A then A

    when @var = B then B

    when @var = C then C

    when...

  • RE: can i do this without using a loop?

    i wish i had a fraction of your intellect...

    thanks for taking the time to answer my question, i learned a new thing today!

    -mm

Viewing 15 posts - 1 through 15 (of 21 total)