Please help :(

  • Hi All,

    I have to show data in reports (day wise and moth wise)

    Like

    In jan month ,we have 31 days so if data is available in 1'jan than show data else show zero ,

    same with 2'jan if data is available then show else show 0 .

    I find my all the data data but don't able to show in dates wise .

    Please help me to complete my report its very urgent .

    Thanks

    Rahul 🙁

  • Is it possible to give some sample data and desired output?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • please reply me of my question only .

    Thanks

  • mithubhudolia (1/27/2012)


    please reply me of my question only .

    Thanks

    In order to help you, you need to provide sufficient information.

    You need to help us help you.

    Please read the first link in my signature on how to post forum questions.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • mithubhudolia (1/27/2012)


    I have to show data in reports (day wise and moth wise)

    Like

    In jan month ,we have 31 days so if data is available in 1'jan than show data else show zero ,

    same with 2'jan if data is available then show else show 0 .

    I find my all the data data but don't able to show in dates wise .

    Please help me to complete my report its very urgent.

    Outer join to a table of numbers (or dates) and replace the NULLs that result with zero.

  • mithubhudolia (1/27/2012)


    please reply me of my question only .

    Thanks

    You need a tally or calendar table (as Paul mentioned above) to fill in the gaps. See the link in my signature for a walkthrough of Tally Table usage. That's the best I can offer with the limited information you've provided.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • mithubhudolia (1/27/2012)


    Hi All,

    I have to show data in reports (day wise and moth wise)

    Like

    In jan month ,we have 31 days so if data is available in 1'jan than show data else show zero ,

    same with 2'jan if data is available then show else show 0 .

    I find my all the data data but don't able to show in dates wise .

    Please help me to complete my report its very urgent .

    Thanks

    Rahul 🙁

    mithubhudolia (1/27/2012)


    please reply me of my question only .

    Thanks

    You don't need an answer, you need a question!


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • mithubhudolia (1/27/2012)


    please reply me of my question only .

    Thanks

    Sure. Answer to your question... just modify code in the following article to work with days instead of months.

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • mithubhudolia (1/27/2012)


    please reply me of my question only .

    Thanks

    How to win friends and influence people :w00t:

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • Mr. Rahul,

    Hope you misunderstood Koen Verbeeck's phrase "Why So Serious" !!!?

    But Note, this was not a reply to your question. it is a part of his signature. It's a message to all.

    But any way, be polite at people.

    Hope u got it.

    Mr. Koen Verbeeck, My kind opinion/request you to revisit this phrase, which creates misunderstandings..

    All, Sorry for deviating the topic. Enjoy..

    Regards,

    Muhammadh Rafi

Viewing 10 posts - 1 through 9 (of 9 total)

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