Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql MS access在transform pivot中的使用案例_Sql_Ms Access_Case_Transform - Fatal编程技术网

Sql MS access在transform pivot中的使用案例

Sql MS access在transform pivot中的使用案例,sql,ms-access,case,transform,Sql,Ms Access,Case,Transform,我正在尝试使用access中的查询打印计划。问题是,当没有人计划任务时,该字段留空。问题是,在整个计划期间,没有人计划执行某项任务,因为没有人被分配执行此任务,所以某些引用会被中断。因此,我的问题是,我可以在查询中使用一个简单的案例,将Responsable.responsablebrege上的null值切换为“”或“N/a”之类的值,还是我从错误的角度看它?代码如下: TRANSFORM First(Responsable.ResponsableAbrege) AS PremierDeResp

我正在尝试使用access中的查询打印计划。问题是,当没有人计划任务时,该字段留空。问题是,在整个计划期间,没有人计划执行某项任务,因为没有人被分配执行此任务,所以某些引用会被中断。因此,我的问题是,我可以在查询中使用一个简单的案例,将Responsable.responsablebrege上的null值切换为“”或“N/a”之类的值,还是我从错误的角度看它?代码如下:

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");

在MS Access SQL中,而不是在
情况下
您应该使用
IIF
开关

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

谢谢IIF工作,虽然不完全,但我仍然有一个问题,那就是如果在整个时间范围内没有安排任何人,那么整行就没有显示。我猜这和我的内心连接有关。仍在调查中,但非常感谢!我还没有仔细检查过您的SQL查询,但根据您的解释,我将把一些内部联接转换为左联接