Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Create a YTD Query
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
How to Create a YTD Query
Divers
Thread ID:
00638903
Message ID:
00638903
Vues:
46
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform