Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Create a YTD Query
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
How to Create a YTD Query
Miscellaneous
Thread ID:
00638903
Message ID:
00638903
Views:
44
I need to create a report that shows the number of procedures done for each month (jan-Dec). I'm not sure where in the table structure I need to start. I have a procedure table, but it has 7500 records and not every one will have been done. Below is the basic table structure to a "case".
Meetings Table.  Each case has one record in the meetings table.  Primary key is meetingnumber.

Meetproc Table.  Each case has 1 or more records  It is FK to the meetings table on meetingnumber.

meetingnumber, proceduredescription, procedureCode, procID

coProc Table.  All the procedures.  Primary key is procid


Desired Results:
----------------------------------------------------------------------------
DESC    JAN  FEB  MAR  APR  MAY  JUN  JUL  AUG  SEP  OCT  NOV  DEC
----------------------------------------------------------------------------
lapc     1    0    12   12   0    1    3    2   12    300  12   0
heartb   2    2    0     0   2    1    4    3   10     12   9   2
Next
Reply
Map
View

Click here to load this message in the networking platform