Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Help with query please
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Cliff
Average Member

United States
501 Posts

Posted - 19 November 2003 :  22:38:29  Show Profile  Visit Cliff's Homepage
I am trying to write a query for Access. Here is what I have so far

SELECT Employees.Emp_ID, Employees.Last_Name, Employees.First_Name, Employees.Active_Inactive, Employees.Email, BBTS.Numb, BBTS.Standard, BBTS.BWHLab
FROM Employees INNER JOIN BBTS ON Employees.Emp_ID Like 'BBTS.BWHLab%'
WHERE Employees.Active_Inactive = 'A'

Here is where the problem is. I hoped I could use "Like" in the join statement, but I get an error saying it's not supported. The info I have is from two table, one has data, the other has employee info. The data table "BBTS" has a field that has three parts to it, the Emp_id first name and last name (don't ask why I did it this way). The Emp_ID field is just that, the Emp_ID only.

So what I need to accomplish is match the records where the Emp_ID field is also the beginning of the BWHLab field.

i.e.

123456 = 123456 Robert Smith

I have this working on another page using it as a where statement, but I don't think that will work in this case.

Any suggestions are appreciated.

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 19 November 2003 :  23:10:25  Show Profile
why won't it work in this case if it worked on another page? I would also suggest that you just restructure your table to that you have a field in the BBTS table that matches just the employee ID. It would make your queries a lot less complicated.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Cliff
Average Member

United States
501 Posts

Posted - 19 November 2003 :  23:18:41  Show Profile  Visit Cliff's Homepage
Nikkol,
The like part worked in a where clause on the other page, now I am trying to put it in the join clause, it doesn't seem to like that.

I knew I was shooting myself when I set it up this way, I suspect I will need to simply cut and paste the first part of the field into a new field.

Structure is everything.

Thanks.
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 20 November 2003 :  00:19:00  Show Profile
Don't use a join then.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07