Following is the way to get date/time difference in OBIEE
- Use TIMESTAMPDIFF function
- Format:
TIMESTAMPDIFF(SQL_TSI_DAY, [From Timestamp], [To Timestamp])
- Difference in seconds, minutes, hours, days, weeks etc can be obtained by using these intervals in the function;
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR
Example:
TIMESTAMPDIFF(SQL_TSI_DAY, TIMESTAMP '2011-12-1 00:00:00', TIMESTAMP '2011-12-31 00:00:00')
Cheers ;)
- Use TIMESTAMPDIFF function
- Format:
TIMESTAMPDIFF(SQL_TSI_DAY, [From Timestamp], [To Timestamp])
- Difference in seconds, minutes, hours, days, weeks etc can be obtained by using these intervals in the function;
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR
Example:
TIMESTAMPDIFF(SQL_TSI_DAY, TIMESTAMP '2011-12-1 00:00:00', TIMESTAMP '2011-12-31 00:00:00')
Cheers ;)
It's vary useful. Thanks
ReplyDelete