Showing posts with label TIMESTAMP. Show all posts
Showing posts with label TIMESTAMP. Show all posts

Tuesday, May 25, 2010

OBIEE TimeStamp Calculations:

David T showed some nice Timstamp calculations on the OTN forum:

http://forums.oracle.com/forums/message.jspa?messageID=4315664#4315664

1) TIMESTAMPADD(SQL_TSI_DAY, (DayOfMonth(CURRENT_DATE))*-1, CURRENT_DATE) will give you the last day of the previous month...


2) TIMESTAMPADD(SQL_TSI_DAY,DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY, (DayOfMonth(CURRENT_DATE))*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, (DayOfMonth(CURRENT_DATE))*-1, CURRENT_DATE)) will give you the Saturday prior to the last week of the month.


3) TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY, (DayOfMonth(CURRENT_DATE))*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, (DayOfMonth(CURRENT_DATE))*-1, CURRENT_DATE))) will give you the Sunday of the last week of the previous month.

Till Next Time

Wednesday, September 24, 2008

OBIEE Timestamp

One of those things you keep forgetting the format on TIMESTAMP:

TIMESTAMP 'YYYY-MM-DD HH24:MI:SS'

TIMESTAMP '1990-01-10 13:35:43'

Till Next Time