Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stored Procedure for dashboard


Stored Procedure for dashboard

Author
Message
smriti.subramanian
smriti.subramanian
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 107
hi,

i have three tables A,B,C in which i have datecreated column and status column in all three tables.
Status will be like 'New','Pending' etc.....
I need to show data in the dashboard like

         A B C
Count of Overdue -New   100   100   100
Count of Overdue -Pending   200   200   200
Count of Today's-New   200   200   200
Count of Today's-Pending   300   300   300
Total         800 800 800
How can i write stored proc to get values in the above manner? Please help
kapil_kk
kapil_kk
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2417 Visits: 2763
Can you please provide us the table structure so that we can try to solve your problem?

Its good practice to provide detailed information so that everyone can understand problem that your are facing.....

_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
toddasd
toddasd
SSC-Addicted
SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)

Group: General Forum Members
Points: 480 Visits: 3788
The "easiest to understand" type of solution is to build a temp table exactly like you want the output to look. Then have individual queries gather the pieces of information and update the temp table as you go along. All of these queries can be wrapped as one in a stored procedure. It's not hard, you just have to break it down into manageable chunks. What have you tried so far?

______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
smriti.subramanian
smriti.subramanian
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 107
Table structure:

create table A
id1 int,
status int
date created datetime

table B
id2 int
status int
date created datetime

table c
id3 int
status int
date created datetime

table status
id
description


The description field will be like pending, new etc...

i need the output as mentioned above..
toddasd
toddasd
SSC-Addicted
SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)

Group: General Forum Members
Points: 480 Visits: 3788
smriti.subramanian (1/22/2013)
Table structure:

create table A
id1 int,
status int
date created datetime

...


I tried running this in SSMS and it didn't parse. If only we had some valid DDL. Oh well...

______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search