Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.5 kB
1
Indexable
Never
{table}
    || Friday ||
    | {sql-data:query=SELECT
        DATE_ADD(
            DATE_SUB(CURRENT_DATE(), INTERVAL (DAYOFWEEK(CURRENT_DATE())+1) % 7 DAY),
            INTERVAL (IF(DAYOFWEEK(CURRENT_DATE()) >= 6, 1, 0)) WEEK
        ) AS friday_1
      |}
    | {sql-data:query=SELECT
        DATE_ADD(
            DATE_ADD(
                DATE_SUB(CURRENT_DATE(), INTERVAL (DAYOFWEEK(CURRENT_DATE())+1) % 7 DAY),
                INTERVAL (IF(DAYOFWEEK(CURRENT_DATE()) >= 6, 1, 0)) WEEK
            ),
            INTERVAL 7 DAY
        ) AS friday_2
      |}
    | {sql-data:query=SELECT
        DATE_ADD(
            DATE_ADD(
                DATE_SUB(CURRENT_DATE(), INTERVAL (DAYOFWEEK(CURRENT_DATE())+1) % 7 DAY),
                INTERVAL (IF(DAYOFWEEK(CURRENT_DATE()) >= 6, 1, 0)) WEEK
            ),
            INTERVAL 14 DAY
        ) AS friday_3
      |}
    | {sql-data:query=SELECT
        DATE_ADD(
            DATE_ADD(
                DATE_SUB(CURRENT_DATE(), INTERVAL (DAYOFWEEK(CURRENT_DATE())+1) % 7 DAY),
                INTERVAL (IF(DAYOFWEEK(CURRENT_DATE()) >= 6, 1, 0)) WEEK
            ),
            INTERVAL 21 DAY
        ) AS friday_4
      |}
    | {sql-data:query=SELECT
        DATE_ADD(
            DATE_ADD(
                DATE_SUB(CURRENT_DATE(), INTERVAL (DAYOFWEEK(CURRENT_DATE())+1) % 7 DAY),
                INTERVAL (IF(DAYOFWEEK(CURRENT_DATE()) >= 6, 1, 0)) WEEK
            ),
            INTERVAL 28 DAY
        ) AS friday_5
      |}
{table}