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)
 Schedule Report

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-19 : 10:15:49
Moez writes "Hi,

I need a stored procedure that will print time in increments of 15minutes on the left column and the name and phone number on the other columns depends on the appointment of the person. This is what I have in a appointment table.


Appointment Table
Appt_ID
Appointment_dt_tm
Patient_ID

Patient Table
Patient_ID
Name
Phone

Test Data Appointment Table
1
2001-09-13 8:00 AM
1

2
2001-09-13 10:15 AM
44

3
2001-09-13 11:00 AM
12

Report In the folowing format

Time                 Name                     Phone Number
07:00
07:15
07:30
07:45
08:00 John Smith 888 888 8888
.
.
.
.
10:00
10:15 Mr Doe 999 999 9999
.
.
11:00 Sandy 999 777 7777
.
.
.
.
.
16:00


How can I create a sql statment that will bring this report back?

Thanks"
   

- Advertisement -