2017-03-21 5 views
0

액세스 할 때 쿼리를 사용하여 일정을 인쇄하려고합니다. 문제는 필드가 비어있는 작업을 아무도 예약하지 않은 경우입니다. 문제는 아무도이 작업을 위해 할당되지 않았기 때문에 어느 누구도 일정에 대한 일정을 예약하지 않은 경우입니다. 일부 참조는 borked가됩니다. 그래서 내 질문은 내가 '또는'N/A '같은 뭔가를 Responsable.ResponsableAbrege null 값을 전환하려면 내 쿼리에서 간단한 사례를 사용할 수 있습니다 또는 내가 잘못된 각도에서 찾고 있습니까? 여기에 코드입니다 :변환 피벗의 대/소문자를 사용하는 MS 액세스

TRANSFORM First(Responsable.ResponsableAbrege) AS PremierDeResponsableAbrege 
SELECT wCalendrier.Entite, Entite.DescriptionAbrege, Tache.Tache, Fonction.Abréviation, Module.Module, Fonction.NoFonction, Tache.NoTache, First(wCalendrier.PremierResponable) AS PremierDePremierResponable 
FROM RecupererResponsable, Fonction INNER JOIN ([Module] INNER JOIN (Équipe INNER JOIN (((wCalendrier INNER JOIN Tache ON wCalendrier.NoTache = Tache.NoTache) INNER JOIN Responsable ON wCalendrier.NoResponsable = Responsable.NoResponsable) INNER JOIN Entite ON wCalendrier.Entite = Entite.Entite) ON (Équipe.NoÉquipe = Responsable.Equipe) AND (Équipe.NoÉquipe = Responsable.Equipe)) ON Module.NoModule = Tache.Module) ON Fonction.NoFonction = Tache.Fonction 
GROUP BY wCalendrier.Entite, Entite.DescriptionAbrege, Tache.Tache, Fonction.Abréviation, Module.Module, Fonction.NoFonction, Tache.NoTache 
PIVOT "D" & [Sequence] In ("D1","D2","D3","D4","D5","D6","D7","D8","D9","D10","D11","D12","D13","D14","D15"); 

답변

0

MS 액세스 SQL에서 당신이 완전하게 입력해도, IIF는 근무 중 IIF 또는 switch

iif(isnull(FIRST(Responsable.ResponsableAbrege)),'N/A', FIRST(Responsable.ResponsableAbrege)) 
+0

감사를 사용해야하는 대신 CASE의가, 난 여전히 전체 행을하지 관한 문제가 전체 시간 프레임에 대해 예정된 사람이 없는지 보여줍니다. 내 INNER JOIN과 관련이있는 것 같습니다. 아직도 조사하고 있지만 무리를 고맙다! – Markasius

+0

나는 당신의 SQL 쿼리를 면밀히 검토하지는 않았지만 당신이 설명하는 것에서부터 당신의 INNER 조인 중 일부를 LEFT 조인으로 바꿀 것이다. –