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