如何比较obiee中的月份?
How to compare month in obiee?
在obiee中如何写这个case语句?
CASE WHEN to_char(to_date(hire_dt, 'MM-DD-YYYY'), 'Month') <> to_char(to_date(start_dt-1, 'MM-DD-YYYY'), 'Month') THEN 1 Else 0
月份不相等:
示例:
0 -> 09/14/2021 09/16/2021
1 -> 12/31/2019 03/15/2017
I just want to compare month regardless of the year.
在 Oracle 中:
CASE
WHEN EXTRACT( MONTH FROM hire_dt ) = EXTRACT( MONTH FROM start_dt )
THEN 1
ELSE 0
END
或
CASE
WHEN TO_CHAR( hire_dt, 'MM' ) = TO_CHAR( start_dt, 'MM' )
THEN 1
ELSE 0
END
这 OBIEE Date functions documentation 建议您可以使用 MONTH
:
CASE
WHEN MONTH( hire_dt ) = MONTH( start_dt )
THEN 1
ELSE 0
END
在obiee中如何写这个case语句?
CASE WHEN to_char(to_date(hire_dt, 'MM-DD-YYYY'), 'Month') <> to_char(to_date(start_dt-1, 'MM-DD-YYYY'), 'Month') THEN 1 Else 0
月份不相等:
示例:
0 -> 09/14/2021 09/16/2021
1 -> 12/31/2019 03/15/2017
I just want to compare month regardless of the year.
在 Oracle 中:
CASE
WHEN EXTRACT( MONTH FROM hire_dt ) = EXTRACT( MONTH FROM start_dt )
THEN 1
ELSE 0
END
或
CASE
WHEN TO_CHAR( hire_dt, 'MM' ) = TO_CHAR( start_dt, 'MM' )
THEN 1
ELSE 0
END
这 OBIEE Date functions documentation 建议您可以使用 MONTH
:
CASE
WHEN MONTH( hire_dt ) = MONTH( start_dt )
THEN 1
ELSE 0
END