Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Ifs, loops and whiles?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-09 : 08:06:28
Tristan writes "I'm trying to fill an appointment book with data from an Appointments table in my database.

What I need to be able to do is to run some kind of loop to check if there are any appointments between say 8:00:00 - 8:59:59, if there are any, I want it to store whatever data there is and continue to 9:00:00 - 9:59:59, if there are no appointments I want to bring back the message "No appointments". I want it to continue until I have a day's worth of data so 8am - 7pm.

I can then use that data to populate a datalist to show say:
8am - 8:15 - 10:15 Title of appointment.
10am - 8:15 - 10:15 Title of appointment.
12pm - No appointments

Hopefully someone can help, it has to be possible but I've had no luck finding a solution so far.

Tristan"

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-03-09 : 08:19:49
Lets see if we can do this without a loop.

please give us the Appointments table layout
and some sample data.

Jim
Users <> Logic
Go to Top of Page
   

- Advertisement -