Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement Help
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
SQL Statement Help
Divers
Thread ID:
00602593
Message ID:
00602593
Vues:
48
Need pointers on how to create the sql statement to retrieve data:

Meetings table contains scheduled appoints that are stand-alone and also block appoints (a block can contain multiple appointments)

key fields
meetingnumber   begintime     endtime   isblock    blockmember       blockid
 unique int       dt            dt        bit        bit               int
===============================================================================
A standalone appointment gets a unique meetingnumber, begintime,endtime, isblock=0,blockmember=0 and blockid=0

A block get a unique meetingnumber, begintime,endtime,isblock = 1, blockmember=0, and blockid=0

An appointment inside a block get a unique meetingnumber, begintime,endtime, isblock=0, blockmember=1 and blockid=meetingnumber of the block

I need a sql statement that would return a meetingnumber of the block, the total blocktime (endtime-begintime) of the block, and the totalblocktimeused.

The total blocktime used would consists of adding up the endtime-begintime of all the appointsment assigned to a block.

Thanks for any help
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform