Date Range Dynamic Column count in sqlserver

  • QP

    dear All

     

    Above format, I need sql server Query

     

  • So what have you tried so far, and where are you stuck?

    -------------------------------------------------------------------------------------------------------------------------------------
    Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses

  • In my requirements input parameter is

    Start date and end date.

     

     

    Based on count I want to create a date column. Based on this column I need a count.

     

  • Ok, what have you tried so far in the way of coding, to get to this goal?

    What have you looked at in terms of syntax that you believe will accomplish the goal, and what is it that is not working for you

  • I need Query for this output. Frankly, i am not good in PIVOT

  • Well have your looked at cross tabs as an alternative to pivot?

    Post your query and we can see where its going wrong.

     

    Just giving you the answer wont be good for you as you're only going to need to support it in your environment, so best to increase the knowledge by helping with what you have already done, rather than here's the query

  • If you want help with actual T-SQL, please take the time to post your data in a format which we can all consume (with CREATE TABLE DDL and INSERT ... VALUES statements reflecting the sample data you have posted)

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • That's an awful lot of points for someone who can't even post consumable data. I guess this is required reading then: Forum Etiquette: How to post data/code on a forum to get the best help

    After that, read this: Cross Tabs and Pivots, Part 1 – Converting Rows to Columns

    Once you apply Jeff's solution, it's really easy.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply