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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looping problem - help

Status
Not open for further replies.

monrosal

Programmer
Aug 22, 2000
42
0
0
US
I'm creating this web appointment system. A company will have a set time like from 9-5, so I loop this in a combo box. and within that loop I do minute increments of 10 minutes, so the combo box looks like 9:10 9:20 9:30...10:10 10:20 10:30....and so on. The problem I'm having is if I have a record in the database for a specific appointment on a certain day, I do not want that time to show up in the combo box. Does anyone know how I can accomplish this?

Thanks in advance
 
I would query your table to get a list of today's events and create an exception array of
each of the used time slots. Then you can check the array when you go through your loop to build the combo box and if the time is listed in the array do not add that time to the combo box. I hope this helps.
 
Why don't you simply creat a table with a field, say timeschedule, refering to time and data of each records in this field is going to be 10 mins increment.
With any appointment made, it will update the corresponding records by UPDATE SQL.
And using SQL to select those records where fields other than the key field, timeschedule, are null or empty.

It should be a lot quicker than using looping.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top