1 2 3 4
| SELECT JourOuvres([DateEnregistrementMSX],Date())-[type_document]![délai]-JourOuvres((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin])),(IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin])),(IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin])),(IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))) AS depassement, table_unique.Ref_W, table_unique.TypeDocument, table_unique.DateEnregistrementMSX, IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut]) AS [DDC1-debut], IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin]) AS [DDC1-fin], IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut]) AS [DDC2-debut], IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin]) AS [DDC2-fin], IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]) AS [DDC3-debut], IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin]) AS [DDC3-fin], type_document.délai
FROM table_unique INNER JOIN type_document ON table_unique.TypeDocument = type_document.[type_document-raccourci]
WHERE (((JourOuvres([DateEnregistrementMSX],Date())-[type_document]![délai]-JourOuvres((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin])),(IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin])),(IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin])),(IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))))>0) AND ((table_unique.DateEnregistrementMSX)>Now()-60) AND ((IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut]))<>0) AND ((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin]))<>0) AND ((IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut]))=0) AND ((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin]))=0) AND ((IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))=0) AND ((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin]))=0) AND ((type_document.délai) Is Not Null) AND ((table_unique.DateTraitement) Is Null)) OR (((JourOuvres([DateEnregistrementMSX],Date())-[type_document]![délai]-JourOuvres((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin])),(IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin])),(IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin])),(IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))))>0) AND ((table_unique.DateEnregistrementMSX)>Now()-60) AND ((IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut]))=0) AND ((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin]))=0) AND ((IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut]))=0) AND ((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin]))=0) AND ((IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))=0) AND ((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin]))=0) AND ((type_document.délai) Is Not Null) AND ((table_unique.DateTraitement) Is Null)) OR (((JourOuvres([DateEnregistrementMSX],Date())-[type_document]![délai]-JourOuvres((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin])),(IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin])),(IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin])),(IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))))>0) AND ((table_unique.DateEnregistrementMSX)>Now()-60) AND ((IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut]))<>0) AND ((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin]))<>0) AND ((IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut]))<>0) AND ((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin]))<>0) AND ((IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))=0) AND ((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin]))=0) AND ((type_document.délai) Is Not Null) AND ((table_unique.DateTraitement) Is Null)) OR (((JourOuvres([DateEnregistrementMSX],Date())-[type_document]![délai]-JourOuvres((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin])),(IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin])),(IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin])),(IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))))>0) AND ((table_unique.DateEnregistrementMSX)>Now()-60) AND ((IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut]))<>0) AND ((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin]))<>0) AND ((IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut]))<>0) AND ((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin]))<>0) AND ((IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))<>0) AND ((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin]))<>0) AND ((type_document.délai) Is Not Null) AND ((table_unique.DateTraitement) Is Null))
ORDER BY JourOuvres([DateEnregistrementMSX],Date())-[type_document]![délai]-JourOuvres((IIf([table_unique]![DDC-delai_1-fin] Is Null,0,[table_unique]![DDC-delai_1-fin])),(IIf([table_unique]![DDC-delai_1-debut] Is Null,0,[table_unique]![DDC-delai_1-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_2-fin] Is Null,0,[table_unique]![DDC-delai_2-fin])),(IIf([table_unique]![DDC-delai_2-debut] Is Null,0,[table_unique]![DDC-delai_2-debut])))-JourOuvres((IIf([table_unique]![DDC-delai_3-fin] Is Null,0,[table_unique]![DDC-delai_3-fin])),(IIf([table_unique]![DDC-delai_3-debut] Is Null,0,[table_unique]![DDC-delai_3-debut]))) DESC; |
Partager