Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Evaluating Time Blocks

Status
Not open for further replies.

Cydamac

Technical User
Mar 27, 2001
16
US
Hey All,

I am working on a database that is being used to track rooms and their hours of availability. These hours are represented in hour-long blocks. There is a record for each hour that the room is not available. I am able to get these records to show in my subreport, but the report becomes huge. If the room is not available for a whole day, then I have 24 hour-long blocks and a total 48 hours that print out. I need to evaluate these records an print them out for continuous blocks.
Example:

Recordset = 12:00a-1:00a, 1:00a-2:00a,2:00a-3:00a,3:00a-4:00a,6:00a-7:00a,7:00a-8:00a


Desired Output = 12:00a-4:00a, 6:00a-8:00a

Any Ideas?
 
What are your table fields? Is "12:00a-1:00a" one field or two--with a start time and an end time? Is it a string field, as it appears to be?

-LB
 
Cydamac

There are a lot of possibile solutions here but we need to know more about your table and field definitions, as lbass says. Can you provide a couple of sample records?

Marc
 
The "BlockStart" is one field and "BlockEnd" is another field. I think that I figured it out last night. I added the block start in one detail section and the block end in another. I added the following supress statements:

Detail Section A (BlockStart):
{RoomList_Blocks.BlockStart} = Previous ({RoomList_Blocks.BlockEnd})

Detail Section B (BlockEnd):
{RoomList_Blocks.BlockEnd} = Next ({RoomList_Blocks.BlockStart})

It is working, but I would still like other suggestions if you all have them. Is this something that I could do, using a fornula evaluation of the data fields?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top