Hello,
Here is my situation:
I have two tables, a reservations table and a schedule table.
I'm making an ASP page that looks up the schedule of an employee but it must remove the reservations allready made from this employee from the reservations table. Here are my table structures:
schedule table columns:
scheduleID employeeid workdate hourcode
reservations table columns:
reservationid employeeid clientid workdate hourcode
Hourcode is simply an integer meaning a 15 minutes fragment during the day between 1 and 96.
I am able to do it by first making a view with schedule and reservations with date and employeeid equal and an inner join on hourcode. I then create a second view that calls the previous view with the schedule table. I put hourcode from schedule "is not null", hourcode from first view "is null" and date the same as the date in previous view with a left outer join on scheduleid from the schedule table.
Anyways this works.. What I would like to know is how do I (from ASP-ADO sqloledb connection) call a select query that calls another query and also passes parameters to that second query !!!. Maybee I need to do it a different way ? Do I need to us stored procedures? I have not used them before.
thank you for your help,
Francis
Here is my situation:
I have two tables, a reservations table and a schedule table.
I'm making an ASP page that looks up the schedule of an employee but it must remove the reservations allready made from this employee from the reservations table. Here are my table structures:
schedule table columns:
scheduleID employeeid workdate hourcode
reservations table columns:
reservationid employeeid clientid workdate hourcode
Hourcode is simply an integer meaning a 15 minutes fragment during the day between 1 and 96.
I am able to do it by first making a view with schedule and reservations with date and employeeid equal and an inner join on hourcode. I then create a second view that calls the previous view with the schedule table. I put hourcode from schedule "is not null", hourcode from first view "is null" and date the same as the date in previous view with a left outer join on scheduleid from the schedule table.
Anyways this works.. What I would like to know is how do I (from ASP-ADO sqloledb connection) call a select query that calls another query and also passes parameters to that second query !!!. Maybee I need to do it a different way ? Do I need to us stored procedures? I have not used them before.
thank you for your help,
Francis