Senin, 05 Maret 2012

Re: [MS_AccessPros] Update query for 5 fields

 

John,

The purpose of the table is to capture the direct reports for all the employees. So there are different levels of management such as below. So we have an employee that is taking over a department and we have to change it in the table of the records currently in the table to the new person. All fields in the table are based on Employee's ID. 
But I think that I figured it out after playing with it and trying some things. The sql statement is below also. Did I do it right? id's needed to be changed because of FERPA laws. 

AstSup/Lead
Supervisor
Asc/Ast Dir
Dept Head 

 

UPDATE tblSupervisorList SET tblSupervisorList.[Ast Sup/Lead] = "1XXXXXXXXX", tblSupervisorList.Supervisor = "1XXXXXXXXX", tblSupervisorList.[Asc/Ast Dir] = "1XXXXXXXXX ", tblSupervisorList.[Dept Head] = "1XXXXXXXXX "
WHERE (((tblSupervisorList.[Ast Sup/Lead]) Like "1XXXXXXXXX ")) OR (((tblSupervisorList.Supervisor) Like "1XXXXXXXXX ")) OR (((tblSupervisorList.[Asc/Ast Dir]) Like "1XXXXXXXXX ")) OR (((tblSupervisorList.[Dept Head]) Like "1XXXXXXXXX "));

Jim Wagner
________________________________

________________________________
From: John Viescas <john@viescas.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Monday, March 5, 2012 8:35 AM
Subject: RE: [MS_AccessPros] Update query for 5 fields


 
Jim-

Yes, it sounds crazy. What is the purpose of the table, what are the relevant
columns, and why do you need to update the employee ID? If all will be set to
the same value, then you can do it in one query.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Nashua, NH)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of luvmymelody
Sent: Monday, March 05, 2012 10:22 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Update query for 5 fields

Hello all

I have a table that has employee Id's in it. The way the table is set up might
sound crazy but it is the way it needs to be. But in each of the columns there
is an employee ID that I need to update to a new ID. Is there a way to update
all 4 columns at the same time without writing 4 update queries?

Thank You

Jim Wagner

The fields are
AstSup/Lead
Supervisor
Asc/Ast Dir
Dept Head
Person ID

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar