January 27, 2012 at 12:10 am
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 🙁
January 27, 2012 at 12:20 am
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
January 27, 2012 at 1:35 am
please reply me of my question only .
Thanks
January 27, 2012 at 1:37 am
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
January 27, 2012 at 2:29 am
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.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
January 27, 2012 at 2:38 am
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.
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
January 27, 2012 at 2:48 am
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!
January 27, 2012 at 6:49 am
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
Change is inevitable... Change for the better is not.
January 27, 2012 at 11:05 pm
January 28, 2012 at 5:51 am
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