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

ASP-ADO creating a Select Query that calls another query.

Status
Not open for further replies.

flebel

IS-IT--Management
Mar 11, 2001
3
0
0
CA
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top