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]
FROM type_document INNER JOIN table_unique ON type_document.[type_document-raccourci] = table_unique.TypeDocument
WHERE (((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 ((table_unique.[FO-BO])="FO") AND ((table_unique.DateTraitement) Is Null)) OR (((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 ((table_unique.[FO-BO])="FO") AND ((table_unique.DateTraitement) Is Null)) OR (((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 ((table_unique.[FO-BO])="FO") AND ((table_unique.DateTraitement) Is Null)) OR (((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 ((table_unique.[FO-BO])="FO") 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