|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 8:10 AM
Points: 25,
Visits: 92
|
|
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
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 11:16 PM
Points: 1,061,
Visits: 1,151
|
|
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.....
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 2:42 PM
Points: 477,
Visits: 3,649
|
|
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.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 8:10 AM
Points: 25,
Visits: 92
|
|
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..
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 2:42 PM
Points: 477,
Visits: 3,649
|
|
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.
|
|
|
|