Last Week:
Eg: Monday through Sunday
Description: Based on Todays date, select the Monday of the previous week for the start date and Sunday will be the end date.
Example:
If Today is May 22, 2009
The result would be, Monday = May 11, 2009, Sunday = May 17, 2009
MTD:
If Today is May 22, 2009
I need a result MTD = May 1, 2009 May 21, 2009
LastMonth:
If Today is May 22, 2009
I need a result LastMaont = April 1, 2009 April 30, 2009
Last to LastMonth:
If Today is May 22, 2009
I need a result LastMaont = March 1, 2009 March 31, 2009
I know to get it in DB2 but when I’m trying it in BO its throwing an Error , any suggestions? below is the query which i ran in Db2
LAST WEEK=
with temp(day1) as
(
select date(Current Date) from sysibm.sysdummy1
union all
select day1-1 day from temp where day1>=date(Current Date)-7 day
)
select Date(day1) from temp
where dayofweek(day1) between 1 and 6