update table according to employee id

mohammadagul

PrinceAtif
Local time
Today, 20:00
Joined
Mar 14, 2004
Messages
298
Hello friends,
i posted this question in form section but got no response so iam reposting it again. i think now that this is a right place for this question.

I have been designing a human resource database a company, presently my employer had informed me that he had the pictures of the employees stored in local hard disk.

I am not saving the picture in my forms, just only putting the path of the file from one table (Pictures) in the other (Employees). But the records are too many. Almost 7000 employees. So it is taking to much time to update the database. I decided to use an update query to update all my records at one from the picture table

Table: tblemployees
Employeeid: Autonumber
PicturePath : Text
PictureName : text

Table: pictures
Pictureid : Autonumber
Picturepath: text
Picturename : text

What I did was that I changed the name of all the pictures in PictureName field in picture table to same as the employee field employee table

So Picturename = employeeID

But the EmployeeID (Autonumber are in ascending order where as the picture name [from picture table are neither ascending nor descending there is no sorting of any kind. Further mo0re the picture path is also different for many pictures

I tried usign the update table query with the following SQL

Update Pictures [, tblemployees set tblEmployees.picturename = [pictures].[picturename
Where (((tblEmployees.PictureName) = “EmployeeID”));

This query is not working

What I wanted was the query should check the Picture name in the Picture table and then compare it with the EmployeeId in the tblEmployee. If Picture name were same as the employeeId then it would update my tblEmployees with the corresponding Picturename.
 

Users who are viewing this thread

Back
Top Bottom