It's hard for me to say without seeing the table
layout.  Post it if you can.

Taking a stab in the dark, if I.Instructor_ID is
numeric, remove the single quotes around the 0.   

Is there a column that both tables share?  I see you
referenced a field called 'EmployeeID' but it's in
your where clause.

Mark
--- Jupiter Nyamadi <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have two tables named "instructors" and
> "employees". The table
> "instructors" contains details of course instructors
> inside and
> outside the organisation while the table "employees"
> contains details
> of course instructors within the organisation.
> If the instructor is within the organisation, then
> only the employeeId
> is saved in the "instructors" table and his details
> retrieved from the
> "employees" table. If the instructor is outside the
> organization then
> his details like firstname, lastname, middlename etc
> are stored in the
> "instructors" table.
> 
> I need a single query that can search both tables
> using lastname or
> firstname or middlename fields.
> 
> I tried the following but it didn't work:
> 
>
*********************************************************************************************
> Select I.*, E.* from Instructors I, Employees E
> where I.InstructorType
> = '1' and
> 
> I.instructor_id <> '0' and (I.lastname like
> '%jupiter%' or I.middlename 
> 
> like '%jupiter%' or I.firstname like '%jupiter%' or
> E.lastname like
> '%jupiter%' or E.middlename
> 
> like '%jupiter%' or E.firstname like '%jupiter%') 
> order by
> I.lastname, E.lastname asc
>
************************************************************************************************
> 
> Can someone be of help?
> 
> Thanks,
> Jupiter
> 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to