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

Inner Jion querry with where clause

Status
Not open for further replies.

kronar

Programmer
Jan 12, 2003
60
US
I have a time record table and an employee table joined by EMP_No field. I set up an inner join querry to fill a list box. Works fine till I want to restrict it by date value - it just ingores the where clause. I do not get any errors when run just all the records.

Select ET.fields, JBT.fields from EMP_Table as ET inner join JBT_Table as JBT on ET.Emp_No = ET.Emp_No order by ET_Date DESC

I tried putting the where clause after the on clause.
Thanks for any help
 
Are you typing the SQL by hand, or using the GUI ?

I found a quick and dirty way to create SQL statements is to create a query, switch to SQL view and grab the SQL. Then I cut and paste to wherever it needs to go.




Tyrone Lumley
SoCalAccessPro
 
Probably need to see the WHERE clause you are inserting.

... and do you really have fields in those tables named "Fields"?
 
on ET.Emp_No = [!]JBT[/!].Emp_No

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
fields is just a collection of fields from each table as in "ET.Job_Number"

where clause is " where JBT.Date < 12/30/2006"

Thanks, I will try to set this up in querry also.
 
Did you correct your join clause as I suggested ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top