boa tarde!
estou com probleminha pra tentar montar um consulta union all com critério em forms.
LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
esta aparecendo erro de caracteres encontrados, apos final final da instrução SQL
alguem poderia dar um luz
abraços
estou com probleminha pra tentar montar um consulta union all com critério em forms.
LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
esta aparecendo erro de caracteres encontrados, apos final final da instrução SQL
alguem poderia dar um luz
- Código:
SELECT DISTINCT FILA.ID_GERAL AS PREST, "E-MAIL PROPOSTA CRED" AS Origem, FILA.FILA1 AS SIM_NÃO, FILA.DT1 AS DATA, RESPONSAVEL1 AS RESPONSAVEL
FROM FILA
WHERE (((FILA.[DT1]) Is Not Null) AND ((FILA.[FILA1])=TRUE))
AND ((RESPONSAVEL1) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
Union All
SELECT DISTINCT ID_GERAL AS PREST, "PROSPEÇÃO PREST REGIÃO", FILA2, DT2, RESPONSAVEL2 AS RESPONSAVEL
FROM FILA WHERE ((DT2) IS NOT NULL) and ((FILA2)=TRUE)
AND ((RESPONSAVEL2) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
Union All
SELECT DISTINCT ID_GERAL AS PREST, "DOCUMENTAÇÃO PREST ANALIS", FILA3, DT3, RESPONSAVEL3 AS RESPONSAVEL
FROM FILA
WHERE ((DT3)IS NOT NULL) and ((FILA3)=TRUE);
AND ((RESPONSAVEL3) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL
SELECT DISTINCT ID_GERAL AS PREST, "CONFECÇÃO CONTRATO", FILA4, DT4, RESPONSAVEL4 AS RESPONSAVEL
FROM FILA
WHERE ((DT4)IS NOT NULL) and ((FILA4)=TRUE)
AND ((RESPONSAVEL4) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL
SELECT DISTINCT ID_GERAL AS PREST, "VALIDAÇÃO PRESTADOR", FILA5, DT5, RESPONSAVEL5 AS RESPONSAVEL
FROM FILA
WHERE ((DT5)IS NOT NULL) and ((FILA5)=TRUE)
AND ((RESPONSAVEL5) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL
SELECT DISTINCT ID_GERAL AS PREST, "CORREIO", FILA6, DT6, RESPONSAVEL6 AS RESPONSAVEL
FROM FILA
WHERE ((DT6)IS NOT NULL) and ((FILA6)=TRUE)
AND ((RESPONSAVEL6) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL
SELECT DISTINCT ID_GERAL AS PREST, "VALIDAÇÃO DIRETORIA", FILA7, DT7, RESPONSAVEL7 AS RESPONSAVEL
FROM FILA
WHERE ((DT7)IS NOT NULL) and ((FILA7)=TRUE)
AND ((RESPONSAVEL7) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL
SELECT DISTINCT ID_GERAL AS PREST, "RECLAMAÇÃO PRESTADOR", FILA8, DT8, RESPONSAVEL8 AS RESPONSAVEL
FROM FILA
WHERE ((DT8)IS NOT NULL) and ((FILA8)=TRUE)
AND ((RESPONSAVEL8) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL
SELECT DISTINCT ID_GERAL AS PREST, "FINANCEIRO", FILA9, DT9, RESPONSAVEL9 AS RESPONSAVEL
FROM FILA
WHERE ((DT9)IS NOT NULL) and ((FILA9)=TRUE)
AND ((RESPONSAVEL9) LIKE [Forms]![Frm_02_01_01_Principal]![usuario])
UNION ALL SELECT DISTINCT ID_GERAL AS PREST, "DOCUMENTO VIGENTE", FILA10, DT10, RESPONSAVEL10 AS RESPONSAVEL
FROM FILA
WHERE ((DT10)IS NOT NULL) and ((FILA10)=TRUE)
AND ((RESPONSAVEL10) LIKE [Forms]![Frm_02_01_01_Principal]![usuario]);
abraços
Última edição por maguim em 3/10/2018, 22:44, editado 1 vez(es)