Dates based on month

Hi All,
I want to write query which should return the dates based on the month i pass the to query .
like example if pass to my query OCT-09 then it should return
01-oct-09
02-0ct-09
31-oct-09.
Can you please help me on this
Thanks & regs
-RG

with tab as (
select 10 mon,2009 yr from dual)
select
to_date(mon||'-'||yr,'mm-yyyy')+level-1 col
from tab connect by level <=add_months(to_date(mon||' '||yr,'mm yyyy'),1)-to_date(mon||' '||yr,'mm yyyy')Ravi Kumar

Similar Messages

  • Extract Data Based on Year and Month

    My clients have taken an Oracle DB TimeStamp field and
    downloaded it to Access in a TEXT field format.
    Sample data: 20060401001348CS
    All I am trying to do is extract data based on year and
    month. I have equal to 200604*, 200604%. Have also tried to used
    LIKE.
    Nothing works. It just can't be that dificult. Please help.
    Thanks

    After breaking my inquiry down into bits and pieces the
    problem is not just the LIKE, it is a combination of events. The
    entire picture is this:
    User selects Year from a drop down (2006), then selects month
    from drop down (04). I then build a variable called
    EventReport Date with the statement <cfset EventReportDate
    = Session.InquiryYear & Session.InquiryMonth & "%">
    It correctly displays as 200604% - When used by itself as
    below, it works just fine.
    WORKS
    <cquery name="GetEventCount" datasource="CountyDB">
    Select count(AD_ID) as EventCount, TYCOD, TYP_ENG, CURENT,
    CDTS
    FROM aeven
    WHERE CDTS LIKE '#EventReportDate#'
    Group By AG_ID, TYCOD, TYP_ENG, CURENT, CDTS
    </cfquery>
    WORKS (additional WHERE criteria)
    <cquery name="GetEventCount" datasource="CountyDB">
    Select count(AD_ID) as EventCount, TYCOD, TYP_ENG, CURENT,
    CDTS
    FROM aeven
    WHERE ((AG_ID = '#Session.InquiryAgencyCode#') AND (CURENT =
    'T'))
    Group By AG_ID, TYCOD, TYP_ENG, CURENT, CDTS
    </cfquery>
    FAILS **** There is something wrong with the combination of
    the WHERE clause items
    <cquery name="GetEventCount" datasource="CountyDB">
    Select count(AD_ID) as EventCount, TYCOD, TYP_ENG, CURENT,
    CDTS
    FROM aeven
    WHERE ((AG_ID = '#Session.InquiryAgencyCode#') AND (CURENT =
    'T')
    AND (CDTS LIKE '#EventReportDate#'))
    Group By AG_ID, TYCOD, TYP_ENG, CURENT, CDTS
    </cfquery>
    NOTE: There is not an error message, it just comes back with
    zero records.
    MORE LOST THAN EVER! Thanks for your help
    Ron

  • Current week/current Month/YTD data based on user response

    Hi
    I have one attribute request_created_date
    Based on this i want to create one more attribute which will have lovs as week(Request_created_date for current week),monthly(Request_created_date for current week),
    YTD(Request_created_date for current year to date).
    Now i want to use this new attribute (Having LOV as week/Month/YTD) as a report prompt so that user itself can select whether he wants to see
    week/month/YTD data in report.
    To Add to this :
    Req is something like this if user select week , Req_created_dates should be filtered for all the dates of cureent week.
    Req is something like this if user select month , Req_created_dates should be filtered for all the dates of cureent month.
    Req is something like this if user select Year , Req_created_dates should be filtered for all the dates of cureent year.
    How can i achieve this?

    Add One variable
    Time_Data ="Weekly"
    Create Input control (Radio Button)
    Use Custom LOVs (Add Weekly , Monthly , Yearly ).
    Set Default (Weekly).
    Now Create Another Variable
    User_Want = ReportFilter([Time_Data])
    Now filter your Report for week , Month or Year (as per Selection) using If else Statement .
    For eg.
    For Week
    [Created_Date] Between RelativeDate(CurrenDate();-7) And CurrentDate()
    For Month
    (Year([Created_Date]) = Year(CurrentDate())  And Month([Created_Date]) = Month(CurrentDate()))
    For Year
    (Year([Created_Date]) = Year(CurrentDate())

  • Last month end date based on current date

    Hi,
    How to show last month end date based on the current date.
    Eg:
    Current date = "08/26/09"
    Var- Last Month End Date = "07/31/09" etc...,
    Please help me how to get it...
    Thank You!

    Good to hear that it worked for you. but not for me.
    I tried like this:
    1st::
    1. var1= ToDate("06/30/09","MM/dd/yyyy")
    2.Var2= RelativeDate([Var1];-DayNumberOfMonth([Var1]))
    result: 5/30/09
    2nd:
    RelativeDate('6/30/2009';-DayNumberOfMonth('6/30/2009'))
    result: 5/30/09
    Am working on SAP OLAP cubes.
    Please help me where am going wrong....
    Thank You!

  • Rolling Months - Month By Month based on month of variable ending date

    Post Author: jeffr
    CA Forum: Formula
    Hi,
    We want to do a rolling 3 month report, based on the ending month where the ending date is entered as a run time parameter, for example run-time parameter - {?Ending Date} entered is 15 June 2007
    First month - should have all of June 2007
    Previous month shoud have all of May 2007
    Earlier month should have all of April 2007
    We tried Month() = Month({?Ending Date}) for current month and
    Month () = Month (DateAdd("m",-1,({?Ending Date}))), and
    Month () = Month (DateAdd("m",-2,({?Ending Date}))) 
    but they didnt work successfully
    Could someone please let us know the best way to do it with Crystal X?
    Thanks

    Post Author: Charliy
    CA Forum: Formula
    You need to get six dates set up as formulas 
    BOM3 = date(year({?parameter}),month(),1)   First day of Month3 = June 1
    EOM3 - do a dateadd of one month to your parameter, then follow above example to make it the first day of next month and subtract one day
    BOM2 first day of EOM2
    EOM2=- BOM3-1
    BOM1  first day of EOM1
    EOM! = BOM2 -1

  • Showing last n months data based on prompt

    Hi,
    I have a "reporting month" prompt like Mar'13 .The report should return last 12 months data for all the measures based on "Reporting Month" prompt and my result will look like below:
    Measures  Mar' 13 Feb 13 Jan 13 ....
    CORP        1345     1444     1555
    ERP           675       877       5678
    I have used a pivot view to get the table view like this but i am not sure how to use the logic for showing all Months .Kindly suggest.

    Hi,
    You can achive this at answers level with the help of presentation variable using "Last N months(Rolling months) data By year-month prompt in OBIEE".
    pl follow the below post.
    http://shivabizint.wordpress.com/2008/09/19/rolling-months-data-for-year-month-prompt-in-obiee/
    thanks

  • Getting aggregated data based on Date in Webi.

    Hi,
                  I have a requirement to display last 6 Months Receviables Month Wise in Webi. And i am getting data based on clearing Date in Bex query. And data from Bex query will be like
           Month             Measure
         01.01.2014       12
         06.01.2014       15
         15.01.2014       16
        02.02.2014        8
        05.02.2014       10
        12.03.2014        4
        14.03.2014        6
        18.03.2014       10
        21.03.2014        20
        30.03.2014       30
       03.04.2014        30
    And i want aggregated data as
    Month  Measure
    Jan      43
    Feb     18
    Mar     66
    Apr     30

    Hi Satish,
    Have you tried below:
    Create Month1 object as =Month([Month]) and [total]as =Sum([Measure])
    Then drag both Month1 and total objects in report block.
    Regards,
    Yuvraj

  • IW69 report not fetching all transaction data of current month.

    Dear Guru Ji,
    While doing testing IW69 report, i noticed that it is not displaying current month data. It is only get the data uptil last date of past month data in DEV & QA client.
    I wonder why this is happening?
    I tried using Malfunction start date & notification reference date input. But still the same result.
    Please guide me, what is going wrong?

    Hi,
    The selection option 'notification date' is based on notification date (VIQMEL-QMDAT). Transaction IW69 is used to display notification items - when there is no item data in the notification nothing will be returned.
    -Paul

  • Selecting records based on month and year parameters

    Hi. I have a sql 2008 r2 stored procedure which needs modifying to return the data based on a start / end month and year.
    It's a large SP so I'll summarise - It accepts four parameters:
    @StartMonth NVARCHAR(10)
    @StartYear NVARCHAR(4)
    @EndMonth NVARCHAR(10)
    @EndYear NVARCHAR(4)
    The current WHERE clause is:
    WHERE ta.TimeByDay BETWEEN '01' + '-' + ltrim(LEFT(@StartMonth, 3)) + '-' + @StartYear
    AND convert(nvarchar,datediff(day, ta.TimeByDay, dateadd(month, 1, ta.TimeByDay))) + '-' + ltrim(LEFT(@EndMonth, 3)) + '-' + @EndYear
    Example of input parameters:
    @StartMonth = N'January',
    @StartYear = N'2014',
    @EndMonth = N'February',
    @EndYear = N'2014',
    Result:
    The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.
    (1 row(s) affected)
    However it executes correctly if we do either of the following:
    1) Run the SQL direct in QA and type in January and February rather than passing in the Start/End Month parameters
    2) As you can see we use the following datediff call to get the number of days per month. IF I replace this with '28', or '31' for example the query also runs (oddly number 1 above then also runs by executing the SP):
    convert(nvarchar,datediff(day, ta.TimeByDay, dateadd(month, 1, ta.TimeByDay)))
    How do I update the WHERE clause to return records between a start/end month and year?
    I'm a day on this so any help appreciated.
    Thanks

    create function NthDayOfMonth (@year int, @month smallint, @weekday varchar(15), @nth smallint)
    returns datetime
    as
    begin
    declare @the_date datetime, @c_date datetime, @cth smallint
    set @cth = 0
    set @c_date = convert(varchar,@year)+'-'+convert(varchar,@month)+'-01'
    while month(@c_date) = @month
    begin
    if datename(weekday,@c_date) = @weekday set @cth = @cth + 1
    if @cth = @nth and datename(weekday,@c_date) = @weekday set @the_date = @c_date
    set @c_date = dateadd(day,1,@c_date)
    end
    return @the_date
    end
    go
    create function Dates(@date datetime)
    returns @table table
    now datetime,
    today datetime,
    Month_start datetime,
    Month_end datetime,
    Prev_Month_Start datetime,
    Prev_Month_End datetime,
    Week_Start datetime,
    Week_End datetime,
    Prev_Week_Start datetime,
    Prev_Week_End datetime,
    Quarter_Start datetime,
    Quarter_End datetime,
    Prev_Quarter_Start datetime,
    Prev_Quarter_End datetime,
    Year_Start datetime,
    Year_End datetime,
    Prev_Year_Start datetime,
    Prev_Year_End datetime,
    Month_End_TS datetime,
    Prev_Month_End_TS datetime,
    Week_End_TS datetime,
    Prev_Week_End_TS datetime,
    Quarter_End_TS datetime,
    Prev_Quarter_End_TS datetime,
    Year_End_TS datetime,
    Prev_Year_End_TS datetime,
    Year smallint,
    Month smallint,
    Day smallint,
    Month_Name varchar(15),
    Day_Name varchar(15),
    WD smallint
    as
    begin
    if @date IS NULL set @date = getdate()
    insert into @table
    select
    @date as now,
    convert(datetime,convert(varchar,@date,101)) as today,
    dateadd(day,0-day(@date)+1,convert(datetime,convert(varchar,@date,101))) as Month_Start,
    dateadd(day,-1,dateadd(month,1,dateadd(day,0-day(@date)+1,convert(datetime,convert(varchar,@date,101))))) as Month_end,
    dateadd(month,-1,dateadd(day,0-day(@date)+1,convert(datetime,convert(varchar,@date,101)))) as Prev_Month_start,
    dateadd(day,-1-day(@date)+1,convert(datetime,convert(varchar,@date,101))) as Prev_Month_End,
    dateadd(day,1-datepart(dw,@date),convert(datetime,convert(varchar,@date,101))) as Week_Start,
    dateadd(day,7-datepart(dw,@date),convert(datetime,convert(varchar,@date,101))) as Week_End,
    dateadd(day,-6-datepart(dw,@date),convert(datetime,convert(varchar,@date,101))) as Prev_Week_Start,
    dateadd(day,0-datepart(dw,@date),convert(datetime,convert(varchar,@date,101))) as Prev_Week_End,
    convert(datetime,convert(varchar,year(@date)) +'-'+ right('0'+convert(varchar,((datepart(QUARTER,@date)-1)*3)+1),2)+'-01') as quarter_start,
    dateadd(day,-1,dateadd(quarter,1,convert(datetime,convert(varchar,year(@date)) +'-'+ right('0'+convert(varchar,((datepart(QUARTER,@date)-1)*3)+1),2)+'-01'))) as quarter_end,
    convert(datetime,convert(varchar,year(dateadd(quarter,-1,@date))) +'-'+ right('0'+convert(varchar,((datepart(QUARTER,dateadd(quarter,-1,@date))-1)*3)+1),2)+'-01') as prev_quarter_start,
    dateadd(day,-1,dateadd(quarter,1,convert(datetime,convert(varchar,year(dateadd(quarter,-1,@date))) +'-'+ right('0'+convert(varchar,((datepart(QUARTER,dateadd(quarter,-1,@date))-1)*3)+1),2)+'-01'))) as prev_quarter_end,
    dateadd(day,1-day(@date),dateadd(month,1-month(@date),convert(varchar,@date,101))) as Year_Start,
    dateadd(year,1,dateadd(day,0-day(@date),dateadd(month,1-month(@date),convert(varchar,@date,101)))) as Year_End,
    dateadd(year,-1,dateadd(day,1-day(@date),dateadd(month,1-month(@date),convert(varchar,@date,101)))) as Prev_Year_Start,
    dateadd(year,-1,dateadd(year,1,dateadd(day,0-day(@date),dateadd(month,1-month(@date),convert(varchar,@date,101))))) as Prev_Year_End,
    dateadd(ms,-3,dateadd(day,0,dateadd(month,1,dateadd(day,0-day(@date)+1,convert(datetime,convert(varchar,@date,101)))))) as Month_End_Ts,
    dateadd(ms,-3,dateadd(day,-1-day(@date)+2,convert(datetime,convert(varchar,@date,101)))) as Prev_Month_End_TS,
    dateadd(ms,-3,dateadd(day,8-datepart(dw,@date),convert(datetime,convert(varchar,@date,101)))) as Week_End_TS,
    dateadd(ms,-3,dateadd(day,1-datepart(dw,@date),convert(datetime,convert(varchar,@date,101)))) as Prev_Week_End_TS,
    dateadd(ms,-3,dateadd(day,0,dateadd(quarter,1,convert(datetime,convert(varchar,year(@date)) +'-'+ right('0'+convert(varchar,((datepart(QUARTER,@date)-1)*3)+1),2)+'-01')))) as quarter_end_TS,
    dateadd(ms,-3,dateadd(day,0,dateadd(quarter,1,convert(datetime,convert(varchar,year(dateadd(quarter,-1,@date))) +'-'+ right('0'+convert(varchar,((datepart(QUARTER,dateadd(quarter,-1,@date))-1)*3)+1),2)+'-01')))) as prev_quarter_end_TS,
    dateadd(ms,-3,dateadd(year,1,dateadd(day,1-day(@date),dateadd(month,1-month(@date),convert(varchar,@date,101))))) as Year_End_TS,
    dateadd(ms,-3,dateadd(day,1-day(@date),dateadd(month,1-month(@date),convert(varchar,@date,101)))) as Prev_Year_End_TS,
    Year(@date) as Year,
    Month(@date) as Month,
    Day(@Date) as Day,
    datename(month,@Date) as Month_Name,
    datename(WEEKDAY,@date) as Day_Name,
    datepart(weekday,@date) as WD
    return
    end
    go
    create function Holidays(@year smallint)
    returns @table table
    date datetime,
    type varchar(10),
    name varchar(25)
    as
    begin
    insert into @table
    select convert(datetime,convert(varchar,@year)+'-01-01') as date,'Holiday' as type ,'New Years Day' as name UNION ALL
    select dbo.NthDayOfMonth(@year,2, 'Monday',3),'Holiday','Family Day' UNION ALL
    select dateadd(d,0-case when datepart(weekday,convert(varchar,@year)+'-05-25') in (1,2) then 5+datepart(weekday,convert(varchar,@year)+'-05-25') else datepart(weekday,convert(varchar,@year)+'-05-25')-1 end, convert(varchar,@year)+'-05-25') ,'Holiday','Victoria Day' UNION ALL
    select convert(varchar,@year)+'-01-07' ,'Holiday','Canada Day' UNION ALL
    select dbo.NthDayOfMonth(@year,8, 'Monday',1),'Holiday','Civic Holiday' UNION ALL
    select dbo.NthDayOfMonth(@year,9, 'Monday',1),'Holiday','Labour Day' UNION ALL
    select dbo.NthDayofMonth(@year,10,'Monday',2),'Holiday','Thanksgiving' UNION ALL
    select convert(varchar,@year)+'-11-11' ,'Holiday','Rememberance Day'UNION ALL
    select convert(varchar,@year)+'-12-25' ,'Holiday','Christmas Day' UNION ALL
    select convert(varchar,@year)+'-12-26' ,'Holiday','Boxing Day'
    update @table
    set date =
    case when name != 'Boxing Day' and datepart(weekday,date) = 7 then dateadd(day,2,date)
    when name != 'Boxing Day' and datepart(weekday,date) = 1 then dateadd(day,1,date)
    when name = 'Boxing Day' and datepart(weekday,date) = 7 then dateadd(day,2,date)
    when name = 'Boxing Day' and datepart(weekday,date) = 1 then dateadd(day,2,date)
    when name = 'Boxing Day' and datepart(weekday,date) = 2 then dateadd(day,1,date)
    else date
    end
    return
    end
    go
    Using these functions (in place of a calendar table) you could do something like this:
    DECLARE @forumTable TABLE (sales MONEY, saleDate DATE)
    INSERT INTO @forumTable (sales, saleDate)
    VALUES
    (123.45, '2014-01-05'),(678.90, '2014-01-06'),(111.21, '2014-01-07'),(314.15, '2014-01-08'),(161.71, '2014-01-09'),
    (819.20, '2014-02-05'),(212.22, '2014-02-06'),(324.25, '2014-02-07'),(262.72, '2014-02-08'),(829.30, '2014-02-09')
    SELECT SUM(f.sales), d.month_end
    FROM @forumTable f
    CROSS APPLY sandbox.dbo.dates(f.saleDate) d
    GROUP BY d.month_end

  • Find the data based on week-end ,week-day

    Hi,
    Db : 11.2.0.1
    We have the table LX_CPU_TRACK_DLY
    desc LX_CPU_TRACK_DLY
    Name Null? Type
    SYSTEMDATE DATE
    HOST_NAME VARCHAR2(50 CHAR)
    USR_PRCT NUMBER(10,5)
    SYS_PRCT NUMBER(10,5)
    WAIT_PRCT NUMBER(10,5)
    IDLE_PRCT NUMBER(10,5)
    PHYS_CPU_USD NUMBER(10,5)
    RUN_Q NUMBER(10,5)
    I want to fetch data based on week end(sat,sun) ,week day(mon-fri) on systemdate column for entire month in two seperate query.
    Any suggestions
    Thanks
    Edited by: 922884 on Nov 22, 2012 11:01 AM

    Hi,
    Thanks
    ilm-426 21-11-2012 20:38:00
    ilm-426 21-11-2012 20:39:00
    ilm-426 21-11-2012 20:40:00
    ilm-426 21-11-2012 20:41:00
    ilm-426 21-11-2012 20:42:00
    ilm-426 21-11-2012 20:43:00
    ilm-426 21-11-2012 20:44:00
    ilm-426 21-11-2012 20:45:00
    ilm-426 21-11-2012 20:46:00
    ilm-426 21-11-2012 20:47:00
    ilm-426 21-11-2012 20:48:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-426 21-11-2012 20:49:00
    ilm-426 21-11-2012 20:50:00
    ilm-426 21-11-2012 20:51:00
    ilm-426 21-11-2012 20:52:00
    ilm-426 21-11-2012 20:53:00
    ilm-426 21-11-2012 20:54:00
    ilm-426 21-11-2012 20:55:00
    ilm-426 21-11-2012 20:56:00
    ilm-426 21-11-2012 20:57:00
    ilm-426 21-11-2012 20:58:00
    ilm-426 21-11-2012 20:59:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-426 21-11-2012 21:00:00
    ilm-429 21-11-2012 20:01:00
    ilm-429 21-11-2012 20:02:00
    ilm-429 21-11-2012 20:03:00
    ilm-429 21-11-2012 20:04:00
    ilm-429 21-11-2012 20:05:00
    ilm-429 21-11-2012 20:06:00
    ilm-429 21-11-2012 20:07:00
    ilm-429 21-11-2012 20:08:00
    ilm-429 21-11-2012 20:09:00
    ilm-429 21-11-2012 20:10:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-429 21-11-2012 20:11:00
    ilm-429 21-11-2012 20:12:00
    ilm-429 21-11-2012 20:13:00
    ilm-429 21-11-2012 20:14:00
    ilm-429 21-11-2012 20:15:00
    ilm-429 21-11-2012 20:16:00
    ilm-429 21-11-2012 20:17:00
    ilm-429 21-11-2012 20:18:00
    ilm-429 21-11-2012 20:19:00
    ilm-429 21-11-2012 20:20:00
    ilm-429 21-11-2012 20:21:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-429 21-11-2012 20:22:00
    ilm-429 21-11-2012 20:23:00
    ilm-429 21-11-2012 20:24:00
    ilm-429 21-11-2012 20:25:00
    ilm-429 21-11-2012 20:26:00
    ilm-429 21-11-2012 20:27:00
    ilm-429 21-11-2012 20:28:00
    ilm-429 21-11-2012 20:29:00
    ilm-429 21-11-2012 20:30:00
    ilm-429 21-11-2012 20:31:00
    ilm-429 21-11-2012 20:32:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-429 21-11-2012 20:33:00
    ilm-429 21-11-2012 20:34:00
    ilm-429 21-11-2012 20:35:00
    ilm-429 21-11-2012 20:36:00
    ilm-429 21-11-2012 20:37:00
    ilm-429 21-11-2012 20:38:00
    ilm-429 21-11-2012 20:39:00
    ilm-429 21-11-2012 20:40:00
    ilm-429 21-11-2012 20:41:00
    ilm-429 21-11-2012 20:42:00
    ilm-429 21-11-2012 20:43:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-429 21-11-2012 20:44:00
    ilm-429 21-11-2012 20:45:00
    ilm-429 21-11-2012 20:46:00
    ilm-429 21-11-2012 20:47:00
    ilm-429 21-11-2012 20:48:00
    ilm-429 21-11-2012 20:49:00
    ilm-429 21-11-2012 20:50:00
    ilm-429 21-11-2012 20:51:00
    ilm-429 21-11-2012 20:52:00
    ilm-429 21-11-2012 20:53:00
    ilm-429 21-11-2012 20:54:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-429 21-11-2012 20:55:00
    ilm-429 21-11-2012 20:56:00
    ilm-429 21-11-2012 20:57:00
    ilm-429 21-11-2012 20:58:00
    ilm-429 21-11-2012 20:59:00
    ilm-429 21-11-2012 21:00:00
    ilm-495 21-11-2012 20:01:00
    ilm-495 21-11-2012 20:02:00
    ilm-495 21-11-2012 20:03:00
    ilm-495 21-11-2012 20:04:00
    ilm-495 21-11-2012 20:05:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:06:00
    ilm-495 21-11-2012 20:07:00
    ilm-495 21-11-2012 20:08:00
    ilm-495 21-11-2012 20:09:00
    ilm-495 21-11-2012 20:10:00
    ilm-495 21-11-2012 20:11:00
    ilm-495 21-11-2012 20:12:00
    ilm-495 21-11-2012 20:13:00
    ilm-495 21-11-2012 20:14:00
    ilm-495 21-11-2012 20:15:00
    ilm-495 21-11-2012 20:16:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:17:00
    ilm-495 21-11-2012 20:18:00
    ilm-495 21-11-2012 20:19:00
    ilm-495 21-11-2012 20:20:00
    ilm-495 21-11-2012 20:21:00
    ilm-495 21-11-2012 20:22:00
    ilm-495 21-11-2012 20:23:00
    ilm-495 21-11-2012 20:24:00
    ilm-495 21-11-2012 20:25:00
    ilm-495 21-11-2012 20:26:00
    ilm-495 21-11-2012 20:27:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:28:00
    ilm-495 21-11-2012 20:29:00
    ilm-495 21-11-2012 20:30:00
    ilm-495 21-11-2012 20:31:00
    ilm-495 21-11-2012 20:32:00
    ilm-495 21-11-2012 20:33:00
    ilm-495 21-11-2012 20:34:00
    ilm-495 21-11-2012 20:35:00
    ilm-495 21-11-2012 20:36:00
    ilm-495 21-11-2012 20:37:00
    ilm-495 21-11-2012 20:38:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:39:00
    ilm-495 21-11-2012 20:40:00
    ilm-495 21-11-2012 20:41:00
    ilm-495 21-11-2012 20:42:00
    ilm-495 21-11-2012 20:43:00
    ilm-495 21-11-2012 20:44:00
    ilm-495 21-11-2012 20:45:00
    ilm-495 21-11-2012 20:46:00
    ilm-495 21-11-2012 20:47:00
    ilm-495 21-11-2012 20:48:00
    ilm-495 21-11-2012 20:49:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:50:00
    ilm-495 21-11-2012 20:51:00
    ilm-495 21-11-2012 20:52:00
    ilm-495 21-11-2012 20:53:00
    ilm-495 21-11-2012 20:54:00
    ilm-495 21-11-2012 20:55:00
    ilm-495 21-11-2012 20:56:00
    ilm-495 21-11-2012 20:57:00
    ilm-495 21-11-2012 20:58:00
    ilm-495 21-11-2012 20:59:00
    ilm-495 21-11-2012 21:00:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-500 21-11-2012 20:01:00
    ilm-500 21-11-2012 20:02:00
    ilm-500 21-11-2012 20:03:00
    ilm-500 21-11-2012 20:04:00
    ilm-500 21-11-2012 20:05:00
    ilm-251 21-11-2012 20:01:00
    ilm-251 21-11-2012 20:02:00
    ilm-251 21-11-2012 20:03:00
    ilm-251 21-11-2012 20:04:00
    ilm-251 21-11-2012 20:05:00
    ilm-251 21-11-2012 20:06:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-251 21-11-2012 20:07:00
    ilm-251 21-11-2012 20:08:00
    ilm-251 21-11-2012 20:09:00
    ilm-251 21-11-2012 20:10:00
    ilm-251 21-11-2012 20:11:00
    ilm-251 21-11-2012 20:12:00
    ilm-251 21-11-2012 20:13:00
    ilm-251 21-11-2012 20:14:00
    ilm-251 21-11-2012 20:15:00
    ilm-251 21-11-2012 20:16:00
    ilm-251 21-11-2012 20:17:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-251 21-11-2012 20:18:00
    ilm-251 21-11-2012 20:19:00
    ilm-251 21-11-2012 20:20:00
    ilm-251 21-11-2012 20:21:00
    ilm-251 21-11-2012 20:22:00
    ilm-251 21-11-2012 20:23:00
    ilm-251 21-11-2012 20:24:00
    ilm-251 21-11-2012 20:25:00
    ilm-251 21-11-2012 20:26:00
    ilm-251 21-11-2012 20:27:00
    ilm-251 21-11-2012 20:28:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-500 21-11-2012 20:06:00
    ilm-500 21-11-2012 20:07:00
    ilm-500 21-11-2012 20:08:00
    ilm-500 21-11-2012 20:09:00
    ilm-500 21-11-2012 20:10:00
    ilm-500 21-11-2012 20:11:00
    ilm-500 21-11-2012 20:12:00
    ilm-500 21-11-2012 20:13:00
    ilm-500 21-11-2012 20:14:00
    ilm-500 21-11-2012 20:15:00
    ilm-500 21-11-2012 20:16:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-500 21-11-2012 20:17:00
    ilm-500 21-11-2012 20:18:00
    ilm-500 21-11-2012 20:19:00
    ilm-500 21-11-2012 20:20:00
    ilm-500 21-11-2012 20:21:00
    ilm-500 21-11-2012 20:22:00
    ilm-500 21-11-2012 20:23:00
    ilm-500 21-11-2012 20:24:00
    ilm-500 21-11-2012 20:25:00
    ilm-500 21-11-2012 20:26:00
    ilm-500 21-11-2012 20:27:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-500 21-11-2012 20:28:00
    ilm-500 21-11-2012 20:29:00
    ilm-500 21-11-2012 20:30:00
    ilm-500 21-11-2012 20:31:00
    ilm-500 21-11-2012 20:32:00
    ilm-500 21-11-2012 20:33:00
    ilm-500 21-11-2012 20:34:00
    ilm-500 21-11-2012 20:35:00
    ilm-500 21-11-2012 20:36:00
    ilm-500 21-11-2012 20:37:00
    ilm-500 21-11-2012 20:38:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-500 21-11-2012 20:39:00
    ilm-500 21-11-2012 20:40:00
    ilm-500 21-11-2012 20:41:00
    ilm-500 21-11-2012 20:42:00
    ilm-500 21-11-2012 20:43:00
    ilm-500 21-11-2012 20:44:00
    ilm-500 21-11-2012 20:45:00
    ilm-500 21-11-2012 20:46:00
    ilm-500 21-11-2012 20:47:00
    ilm-500 21-11-2012 20:48:00
    ilm-500 21-11-2012 20:49:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-500 21-11-2012 20:50:00
    ilm-500 21-11-2012 20:51:00
    ilm-500 21-11-2012 20:52:00
    ilm-500 21-11-2012 20:53:00
    ilm-500 21-11-2012 20:54:00
    ilm-500 21-11-2012 20:55:00
    ilm-500 21-11-2012 20:56:00
    ilm-500 21-11-2012 20:57:00
    ilm-500 21-11-2012 20:58:00
    ilm-500 21-11-2012 20:59:00
    ilm-500 21-11-2012 21:00:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-251 21-11-2012 20:29:00
    ilm-251 21-11-2012 20:30:00
    ilm-251 21-11-2012 20:31:00
    ilm-251 21-11-2012 20:32:00
    ilm-251 21-11-2012 20:33:00
    ilm-251 21-11-2012 20:34:00
    ilm-251 21-11-2012 20:35:00
    ilm-251 21-11-2012 20:36:00
    ilm-251 21-11-2012 20:37:00
    ilm-251 21-11-2012 20:38:00
    ilm-251 21-11-2012 20:39:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-251 21-11-2012 20:40:00
    ilm-251 21-11-2012 20:41:00
    ilm-251 21-11-2012 20:42:00
    ilm-251 21-11-2012 20:43:00
    ilm-251 21-11-2012 20:44:00
    ilm-251 21-11-2012 20:45:00
    ilm-251 21-11-2012 20:46:00
    ilm-251 21-11-2012 20:47:00
    ilm-251 21-11-2012 20:48:00
    ilm-251 21-11-2012 20:49:00
    ilm-251 21-11-2012 20:50:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-251 21-11-2012 20:51:00
    ilm-251 21-11-2012 20:52:00
    ilm-251 21-11-2012 20:53:00
    ilm-251 21-11-2012 20:54:00
    ilm-251 21-11-2012 20:55:00
    ilm-251 21-11-2012 20:56:00
    ilm-251 21-11-2012 20:57:00
    ilm-251 21-11-2012 20:58:00
    ilm-251 21-11-2012 20:59:00
    ilm-251 21-11-2012 21:00:00
    ilm-425 21-11-2012 20:01:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-425 21-11-2012 20:02:00
    ilm-425 21-11-2012 20:03:00
    ilm-425 21-11-2012 20:04:00
    ilm-425 21-11-2012 20:05:00
    ilm-425 21-11-2012 20:06:00
    ilm-425 21-11-2012 20:07:00
    ilm-425 21-11-2012 20:08:00
    ilm-425 21-11-2012 20:09:00
    ilm-425 21-11-2012 20:10:00
    ilm-425 21-11-2012 20:11:00
    ilm-425 21-11-2012 20:12:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-425 21-11-2012 20:13:00
    ilm-425 21-11-2012 20:14:00
    ilm-425 21-11-2012 20:15:00
    ilm-425 21-11-2012 20:16:00
    ilm-425 21-11-2012 20:17:00
    ilm-425 21-11-2012 20:18:00
    ilm-425 21-11-2012 20:19:00
    ilm-425 21-11-2012 20:20:00
    ilm-425 21-11-2012 20:21:00
    ilm-425 21-11-2012 20:22:00
    ilm-425 21-11-2012 20:23:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-425 21-11-2012 20:24:00
    ilm-425 21-11-2012 20:25:00
    ilm-425 21-11-2012 20:26:00
    ilm-425 21-11-2012 20:27:00
    ilm-425 21-11-2012 20:28:00
    ilm-425 21-11-2012 20:29:00
    ilm-425 21-11-2012 20:30:00
    ilm-425 21-11-2012 20:31:00
    ilm-425 21-11-2012 20:32:00
    ilm-425 21-11-2012 20:33:00
    ilm-425 21-11-2012 20:34:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-425 21-11-2012 20:35:00
    ilm-425 21-11-2012 20:36:00
    ilm-425 21-11-2012 20:37:00
    ilm-425 21-11-2012 20:38:00
    ilm-425 21-11-2012 20:39:00
    ilm-425 21-11-2012 20:40:00
    ilm-425 21-11-2012 20:41:00
    ilm-425 21-11-2012 20:42:00
    ilm-425 21-11-2012 20:43:00
    ilm-425 21-11-2012 20:44:00
    ilm-425 21-11-2012 20:45:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-425 21-11-2012 20:46:00
    ilm-425 21-11-2012 20:47:00
    ilm-425 21-11-2012 20:48:00
    ilm-425 21-11-2012 20:49:00
    ilm-425 21-11-2012 20:50:00
    ilm-425 21-11-2012 20:51:00
    ilm-425 21-11-2012 20:52:00
    ilm-425 21-11-2012 20:53:00
    ilm-425 21-11-2012 20:54:00
    ilm-425 21-11-2012 20:55:00
    ilm-425 21-11-2012 20:56:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-425 21-11-2012 20:57:00
    ilm-425 21-11-2012 20:58:00
    ilm-425 21-11-2012 20:59:00
    ilm-425 21-11-2012 21:00:00
    ilm-428 21-11-2012 20:01:00
    ilm-428 21-11-2012 20:02:00
    ilm-428 21-11-2012 20:03:00
    ilm-428 21-11-2012 20:04:00
    ilm-428 21-11-2012 20:05:00
    ilm-428 21-11-2012 20:06:00
    ilm-428 21-11-2012 20:07:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-428 21-11-2012 20:08:00
    ilm-428 21-11-2012 20:09:00
    ilm-428 21-11-2012 20:10:00
    ilm-428 21-11-2012 20:11:00
    ilm-428 21-11-2012 20:12:00
    ilm-428 21-11-2012 20:13:00
    ilm-428 21-11-2012 20:14:00
    ilm-428 21-11-2012 20:15:00
    ilm-428 21-11-2012 20:16:00
    ilm-428 21-11-2012 20:17:00
    ilm-428 21-11-2012 20:18:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-428 21-11-2012 20:19:00
    ilm-428 21-11-2012 20:20:00
    ilm-428 21-11-2012 20:21:00
    ilm-428 21-11-2012 20:22:00
    ilm-428 21-11-2012 20:23:00
    ilm-428 21-11-2012 20:24:00
    ilm-428 21-11-2012 20:25:00
    ilm-428 21-11-2012 20:26:00
    ilm-428 21-11-2012 20:27:00
    ilm-428 21-11-2012 20:28:00
    ilm-428 21-11-2012 20:29:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-428 21-11-2012 20:30:00
    ilm-428 21-11-2012 20:31:00
    ilm-428 21-11-2012 20:32:00
    ilm-428 21-11-2012 20:33:00
    ilm-428 21-11-2012 20:34:00
    ilm-428 21-11-2012 20:35:00
    ilm-428 21-11-2012 20:36:00
    ilm-428 21-11-2012 20:37:00
    ilm-428 21-11-2012 20:38:00
    ilm-428 21-11-2012 20:39:00
    ilm-428 21-11-2012 20:40:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-428 21-11-2012 20:41:00
    ilm-428 21-11-2012 20:42:00
    ilm-428 21-11-2012 20:43:00
    ilm-428 21-11-2012 20:44:00
    ilm-428 21-11-2012 20:45:00
    ilm-428 21-11-2012 20:46:00
    ilm-428 21-11-2012 20:47:00
    ilm-428 21-11-2012 20:48:00
    ilm-428 21-11-2012 20:49:00
    ilm-428 21-11-2012 20:50:00
    ilm-428 21-11-2012 20:51:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-428 21-11-2012 20:52:00
    ilm-428 21-11-2012 20:53:00
    ilm-428 21-11-2012 20:54:00
    ilm-428 21-11-2012 20:55:00
    ilm-428 21-11-2012 20:56:00
    ilm-428 21-11-2012 20:57:00
    ilm-428 21-11-2012 20:58:00
    ilm-428 21-11-2012 20:59:00
    ilm-428 21-11-2012 21:00:00
    ilm-495 21-11-2012 20:01:00
    ilm-495 21-11-2012 20:02:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:03:00
    ilm-495 21-11-2012 20:04:00
    ilm-495 21-11-2012 20:05:00
    ilm-495 21-11-2012 20:06:00
    ilm-495 21-11-2012 20:07:00
    ilm-495 21-11-2012 20:08:00
    ilm-495 21-11-2012 20:09:00
    ilm-495 21-11-2012 20:10:00
    ilm-495 21-11-2012 20:11:00
    ilm-495 21-11-2012 20:12:00
    ilm-495 21-11-2012 20:13:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:14:00
    ilm-495 21-11-2012 20:15:00
    ilm-495 21-11-2012 20:16:00
    ilm-495 21-11-2012 20:17:00
    ilm-495 21-11-2012 20:18:00
    ilm-495 21-11-2012 20:19:00
    ilm-495 21-11-2012 20:20:00
    ilm-495 21-11-2012 20:21:00
    ilm-495 21-11-2012 20:22:00
    ilm-495 21-11-2012 20:23:00
    ilm-495 21-11-2012 20:24:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:25:00
    ilm-495 21-11-2012 20:26:00
    ilm-495 21-11-2012 20:27:00
    ilm-495 21-11-2012 20:28:00
    ilm-495 21-11-2012 20:29:00
    ilm-495 21-11-2012 20:30:00
    ilm-495 21-11-2012 20:31:00
    ilm-495 21-11-2012 20:32:00
    ilm-495 21-11-2012 20:33:00
    ilm-495 21-11-2012 20:34:00
    ilm-495 21-11-2012 20:35:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:36:00
    ilm-495 21-11-2012 20:37:00
    ilm-495 21-11-2012 20:38:00
    ilm-495 21-11-2012 20:39:00
    ilm-495 21-11-2012 20:40:00
    ilm-495 21-11-2012 20:41:00
    ilm-495 21-11-2012 20:42:00
    ilm-495 21-11-2012 20:43:00
    ilm-495 21-11-2012 20:44:00
    ilm-495 21-11-2012 20:45:00
    ilm-495 21-11-2012 20:46:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:47:00
    ilm-495 21-11-2012 20:48:00
    ilm-495 21-11-2012 20:49:00
    ilm-495 21-11-2012 20:50:00
    ilm-495 21-11-2012 20:51:00
    ilm-495 21-11-2012 20:52:00
    ilm-495 21-11-2012 20:53:00
    ilm-495 21-11-2012 20:54:00
    ilm-495 21-11-2012 20:55:00
    ilm-495 21-11-2012 20:56:00
    ilm-495 21-11-2012 20:57:00
    HOST_NAME TO_CHAR(SYSTEMDATE,
    ilm-495 21-11-2012 20:58:00
    ilm-495 21-11-2012 20:59:00
    ilm-495 21-11-2012 21:00:00
    1620 rows selected.
    Thanks

  • How to display dates in half-months?

    How can I display dates in half-months from dim_date table? like shown below:
    Assume that 8/14/2012 is current date..
    07/15 - 07/30 - no. of opties created between those dates
    07/01 - 07/14 - no. of opties created
    06/15 - 06/30 - ...
    06/01- 06/14 - ...
    How can display the dates in those buckets? Any ideas appreciated.
    Thanks in adv.

    Try to build the same in RPD using the below sql.
    I've created a Flag based on W_DAY_D."DAY_OF_MONTH" <= 14 then 'F' else 'S' end
    in answers I've got min and max based on exp: min(Time."Row Wid" by Time.Flag)
    WITH
    SAWITH0 AS (select distinct T31328."PER_NAME_MONTH" as c1,
    case when T31328."DAY_OF_MONTH" <= 14 then 'F' else 'S' end as c2
    from
    "W_DAY_D" T31328 /* Dim_W_DAY_D_Common */
    where ( T31328."PER_NAME_YEAR" = '2012' ) ),
    SAWITH1 AS (select min(T31328."ROW_WID") as c1,
    max(T31328."ROW_WID") as c2,
    case when T31328."DAY_OF_MONTH" <= 14 then 'F' else 'S' end as c3
    from
    "W_DAY_D" T31328 /* Dim_W_DAY_D_Common */
    where ( T31328."PER_NAME_YEAR" = '2012' )
    group by case when T31328."DAY_OF_MONTH" <= 14 then 'F' else 'S' end )
    select distinct SAWITH0.c1 as c1,
    case when SAWITH0.c2 is not null then SAWITH0.c2 when SAWITH1.c3 is not null then SAWITH1.c3 end as c2,
    SAWITH1.c1 as c3,
    SAWITH1.c2 as c4
    from
    SAWITH0 full outer join SAWITH1 On SAWITH0.c2 = SAWITH1.c3
    Hope this helps, pls mark

  • EXTRACT DATA BASED ON BUDGET YEAR

    I have a scenario where I need to extract data based on the users enter the budget year.
    Our budget year is as follow:
    September,
    October,
    November,
    December,
    January,
    February,
    March,
    April,
    May,
    June,
    July,
    August
    If the users enter the budget year as 2014, I want to extract payment records from September 2013 to August 2014.
    September 2013,
    October 2013,
    November 2013,
    December 2013,
    January 2014,
    February 2014,
    March 2014,
    April 2015,
    May 2014,
    June 2014,
    July 2014,
    August 2014
    My query below only extracts payment records created for a given year which is not what I want
    DECLARE @BudgetYear Datetime
    SET @BudgetYear = '09/01/2014'
    SELECT 'REFUND' PaymentType ,pa.CreateDate,YEAR(pa.CreateDate) CreateYear, p.PaymentAmount
    FROM tblPaymentAllocation pa
    INNER JOIN tblReturn r
    ON r.ReturnID = pa.ReturnID
    INNER JOIN tblAccount a
    ON a.AccountID = r.AccountID
    INNER JOIN tblCommunity c
    ON a.Community = c.CommunityCode
    INNER JOIN tblAccountingDate ad
    ON ad.AccountingdateID = pa.AccountingDateID
    INNER JOIN tblPayment p
    ON pa.PaymentID=p.PaymentID
    WHERE YEAR(pa.CreateDate) = YEAR(@BudgetYear )
    AND p.PaymentType <> 'amended'
    AND r.ReturnType = 'refund'
    AND NOT (p.PaymentType = 'check'
    AND pa.Status = 'reversal' AND pa.PriorCredit < 0)

    Give this a go:
    SELECT 'REFUND' PaymentType ,pa.CreateDate,YEAR(pa.CreateDate) CreateYear, p.PaymentAmount
    FROM tblPaymentAllocation pa
    INNER JOIN tblReturn r
    ON r.ReturnID = pa.ReturnID
    INNER JOIN tblAccount a
    ON a.AccountID = r.AccountID
    INNER JOIN tblCommunity c
    ON a.Community = c.CommunityCode
    INNER JOIN tblAccountingDate ad
    ON ad.AccountingdateID = pa.AccountingDateID
    INNER JOIN tblPayment p
    ON pa.PaymentID=p.PaymentID
    WHERE pa.CreateDate BETWEEN CASE WHEN MONTH(GETDATE()) < 9 THEN CONVERT(VARCHAR,YEAR(GETDATE())-2)+'-09-01' ELSE CONVERT(VARCHAR,YEAR(GETDATE())-1)+'-09-01'END AND CASE WHEN MONTH(GETDATE()) < 9 THEN CONVERT(VARCHAR,YEAR(GETDATE())-1)+'-08-31' ELSE CONVERT(VARCHAR,YEAR(GETDATE()))+'-08-31' END
    AND p.PaymentType <> 'amended'
    AND r.ReturnType = 'refund'
    AND NOT (p.PaymentType = 'check'
    AND pa.Status = 'reversal' AND pa.PriorCredit < 0)
    It calculates what the range should be on the fly.

  • To retrive previous month based on month prompt

    Hi,
    My universe is based on SAP BEX query. I have a requirement to report the previous month data based on a month prompt. Since the universe is based on the MDX, could anyone suggest a way to calculate previous month from universe.
    Appreciate your responses.
    Regards,
    VyshBO

    pvinesh wrote:
    Hi VyshBO,
    >
    > You can refer below syntax and prepare a filter object in universe to get Previous Month.
    >
    >
    <FILTER KEY="[ZMONTH].[LEVEL01].[[ZMONTH]].[Value]"><CONDITION OPERATORCONDITION="Equal"><CONSTANT CAPTION="-1"/></CONDITION></FILTER>
    >
    >
    > Regards,
    > Vinesh
    Can  you explain that syntax, Vinesh? In particular, what does the [[ZMONTH]] imply?

  • Custom Exit "Previous Date" based on sy-datum

    Hi!
    I want to make a custom exit that I can use as a variable to get previous date based on current date (sy-datum), but I have some problems getting it to work.
    Here is the code:
    WHEN 'ZCPRDAY'.
        Returns the previous day for current calendar month*
        CHECK i_step = 2.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          l_s_range-low  = sy-datum - 1.
          APPEND l_s_range TO e_t_range.
    When a create an variable on this and use it on an infoobject, I get the message
    Values for InfoObject SC_OP_DAT have a maximum length of 8 characters. The user exit for variable ZCPRDAY delivers value ", that is longer than 8 characters.
    can anyone tell me what I am doing wrong here?
    Thanks!

    Hi  helge ovstedal,
    Again type problem:
    WHEN 'ZCPRDAY'.
    * Returns the previous day for current calendar month
    DATA: L_PREDAY TYPE SY-DATUM. " declare field with reference to sy-datum
    CHECK i_step = 2.
    L_PREDAY = SY-DATUM - 1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    MOVE L_PREDAY TO l_s_range-low . "as datatypes are different, use move instead of =
    APPEND l_s_range TO e_t_range.
    Hope it Helps
    Srini

  • Restrict Query Data based on Date range and Users

    Hi All,
    I have a few web reports that I need do restrict data based on Users.
    In all the queries i have an infoobject 0CALDAY, and  a User Entry range variable on it. Because of performance issues  I need to restrict the range of dates a User can see. Typically most of users could go to a max date range of 1 month back. But some others would need the ability to see data for much bigger range of dates.
    Pls suggest how should i go about with this. Should I have to enforce this at Variable level(user exit).... but then i might have to maintain a table for the users.. Is there any other way of doing it.
    thanks
    Raj

    Any thoughts ?

Maybe you are looking for