Senin, 02 Oktober 2017

Re: [MS_AccessPros] IIF expression question

 

Duane,

You had already answered the question in an earlier post. I was working on another query and I did not remember your answer until after I submitted this morning. Thank You So Much.


Jim Wagner


On ‎Monday‎, ‎October‎ ‎02‎, ‎2017‎ ‎11‎:‎12‎:‎17‎ ‎AM, Jim Wagner luvmymelody@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:


 

already answered. was an old question.

Jim Wagner


On ‎Monday‎, ‎October‎ ‎02‎, ‎2017‎ ‎10‎:‎31‎:‎35‎ ‎AM, luvmymelody@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:


 

Hello all,


I have a query that I am trying to get the ReportingTo column to populate with the person that the employee reports to. I have a table that has fields as below. the Dept head is always populated but the Asc/Ast Dir field is sometimes blank as well as the Supervisor. So there are direct reports with no one between them and the dept head.

I have a query that gets most of the ReportTo column to populate but the missing Asc/Ast dir field that is not populated messing things up. I think I may have the fields in the wrong order or something.




SELECT SupervisorTable.[Person Nm], SupervisorTable.[Person Id], AccrualsForReport.sick, AccrualsForReport.comp, AccrualsForReport.vac, AccrualsForReport.[Accrual Proc Dt], AccrualsForReport.[Last Name], AccrualsForReport.[First Name], SupervisorTable.[Dept Head], SupervisorTable.[Asc/Ast Dir], SupervisorTable.Supervisor, SupervisorTable.[Ast Sup/Lead], AccrualsForReport.ReportsToName, AccrualsForReport.[Reports To], AccrualsForReport.ReportsToID, IIf(IsNull([Asc/Ast Dir]),[Dept Head],IIf(IsNull([Supervisor]),[Asc/Ast Dir],IIf(IsNull([Ast Sup/Lead]),[Supervisor],IIf(IsNull([Ast Sup/Lead]),[Supervisor])))) AS ReportingTo
FROM SupervisorTable INNER JOIN AccrualsForReport ON SupervisorTable.[Person Id] = AccrualsForReport.Emplid
WHERE (((SupervisorTable.[Person Id]) Not Like "1208509350"));





Dept Head

Asc/Ast Dir

Supervisor

Ast Sup/Lead



Thank You for any help

Jim Wagner

__._,_.___

Posted by: Jim Wagner <luvmymelody@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar