Bonjour à tous, j'ai un problème sous BO avec ce code, (c'est la borne inf ou sup pour une tranche de dates) j'ai regardé un peu avec Bruno2r et nous avons convenu de vous soumettre le code SQL pour que vous puissiez y jeter un coup d'oeil, car à nos yeux, redondance redondance... Par avance, merci.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
CGL_INTERCO_DIV.PERIOD_NAME IN (SELECT GL_PERIODS.PERIOD_NAME
                                         FROM GL_PERIODS
                                        WHERE (GL_PERIODS.period_year >
                                              (SELECT P1.period_year
                                                  FROM gl_periods P1
                                                 WHERE gl_periods.period_type =
                                                       P1.period_type
                                                   AND gl_periods.period_set_name =
                                                       P1.PERIOD_SET_NAME
                                                   AND P1.period_name =
                                                       UPPER(@variable('1 - Periode debut / Start Period (MMM-YY)'))))
                                           OR (GL_PERIODS.period_year =
                                              (SELECT P2.period_year
                                                  FROM gl_periods P2
                                                 WHERE gl_periods.period_type =
                                                       P2.period_type
                                                   AND gl_periods.period_set_name =
                                                       P2.PERIOD_SET_NAME
                                                   AND P2.period_name =
                                                       UPPER(@variable('1 - Periode debut / Start Period (MMM-YY)'))) AND
                                              GL_PERIODS.period_num >=
                                              (SELECT P3.period_num
                                                  FROM gl_periods P3
                                                 WHERE gl_periods.period_type =
                                                       P3.period_type
                                                   AND gl_periods.period_set_name =
                                                       P3.PERIOD_SET_NAME
                                                   AND P3.period_name =
                                                       UPPER(@variable('1 - Periode debut / Start Period (MMM-YY)')))))