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)
 Finding an unused date range

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-17 : 15:04:22
Michael writes "I've been trying to work out how to get this into a stored procedure exclusively, but the only information I've been able to find is on Oracle SQL. I can easily work it out by traversing the recordset in my application, but this seems to me a messy, expensive operation when it need not be. It seems to me that for so common an application it should be doable in one stored procedure.

This is a scheduling program, which ideally would find the first available date/time to make an appointment.

For example: If a certain service takes two hours to render, check the dataset for a two hour (or more) window.

My existing data consists simply of Appt_ID, StartTime, EndTime. I've thought of checking the last record's EndTime and the current record's StartTime, but I'm not sure I can examine the data this way within the stored procedure.

This will also have to (potentially) schedule up to two years in advance, so keeping it as compact as possible is essential.

Thanks in advance."

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-17 : 15:22:33
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36406

Tara
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2004-06-17 : 15:26:00
Tara You trying to create a infinite loop?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36406
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36406


Jim
Users <> Logic
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-17 : 15:28:04
D'oh! Here's what I meant to paste:

http://www.sqlteam.com/item.asp?ItemID=12654

Tara
Go to Top of Page
   

- Advertisement -