Format Date Range in Select Statement e.b. 4/10/14 - 4/09/15

So far thanks for all the help you've provided me on here. I'm a long time Access developer and have just worked with SQL very little throughout the years but now I'm working full-scale in it, so a learning process for me.
I am familiar with the DateADD function in SQL DATEADD(mm, 1, GETDATE())  AS MyDate. The part that I'm struggling with is that I need to show a date range in a single field. I can not do it by having that function twice because of the character"-",
which will throw and error. I played around with the "Convert" function some and I am thinking that a combination of the Convert and DateADD functions would be the way to accomplish this but I'm not sure.
Basically what I need is using today's date as an example, I would need the result to return 04/10/14-04/09/15. Any assistance would be appreciated.

This is not being used as a back-end to any type of user interface, so doing it on the front-end is not an option. The data is being exported out to text files, so it needs to be exactly as I had in the example as a single field.
Thanks all for the feedback. Latheesh's post is the closest to what I need, in fact it's exactly what I'm looking for, which is below.
Select Convert(varchar(20),DATEADD(mm, 1, GETDATE()),10 ) +' ---- '+ Convert(Varchar(20),DATEADD(mm, 12, GETDATE()),10)
Ok, I got it working. Actually, turns out that it's not much different than Access syntax other than convert is used in place of Format. DateAdd, DateDiff, etc. are all used in Access as well. Thanks for all the help.

Similar Messages

  • Date equality in select statement

    Date equality in select statement giving 0 result even table contains record matching to it.please suggest what wrong in this query
    1- select *from  EOE_POC.PRODUCT_TEST_REPORT where CREATE_DATE = '03-SEP-13'
    2 - select *from  EOE_POC.PRODUCT_TEST_REPORT where CREATE_DATE >= '03-SEP-13'
    above query (2nd one) is giving 2 records.But I am intend to check for equality not greater ..plz enlighten

    Deekay wrote:
    Thanks Bhushan.
    select *from  EOE_POC.PRODUCT_TEST_REPORT where CREATE_DATE = sysdate
    can u plz throw some more light how to check by sysdate?
    Assuming CREATE_DATE is -- as it should be -- defined as a DATE (not a varchar) you need to be aware of the fact that DATEs always carry "time" as well.   So sysdate is not just "today", it is "this very second".    That's why you need to consider the use of TRUNC when you want to compare dates without consideration for the time.
    The other thing you need to be aware of is that the literal '03-SEP-13' is not a DATE, but a character string that humans would tend to recognize as representing a date.  But to a computer it is still just a character string, fundamentally no different from "here's yer sign!".  Therefore, in your usage of comparing the character string '03-SEP-13' to the DATE in CREATE_DATE, oracle has to to an implicit conversion.  And to do that implicit conversion it has to know what part of the character string represents the day, the month, the year, and possibly the hour, minute, and second.  To do this, it relies on the current setting of NLS_DATE_FORMAT, which may or may not be what you expect.    Please see: http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/ - But I want to store my date as ...  for a more complete explanation.
    And finally, why are you using 2-digit years?  Are you actually working in IT and never heard of "the Y2K problem"?  Fifteen years ago I and thousands of my colleagues began a two-year grind of busting our butts to make sure systems continued to function correctly when the current date became 01-Jan-2000.  Please don't repeat the same mistakes that caused that problem.

  • Usgent: using jsp date in sql select statement

    i have something like this:
    String day;
    String month;
    String year;
    select * from event where date = xxx
    where xxx is supposed to be obtained from the strings (day, month, year) and changed into a format that can be compared to in the select statement.
    what should xxx be?
    thks as lot cos i ahe been figuring out for very long.

    Use PreparedStatement and SimpleDateFormat:
    String year = "2002";
    String month = "9";
    String day = "12";
    String sDate = day + "/" + month + "/" + year;
    SimpleDateFormat df = new SimpleDateFormat("M/d/yyyy");
    Date dDate = df.parse(sDate);
    Connection con = DriverManager.getConnection(user, pw);
    PreparedStatement ps = con.prepareStatement("SELECT * FROM event WHERE date = ?");
    ps.setDate(1, dDate);
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    rs.close();
    ps.close();
    con.close();

  • Compute Date Range with SQL Statement

    I'm sure there is a way to do this in SQL, but I cannot figure it out. I can write a PL/SQL script to do it, but would prefer using a SQL Statement. My database is Oracle Database 10.2.0.4.0.
    I have a table that contains information such as the employee number, department id, and the effective date of when the person started in that department. There is data in another table that I want to update their department number in based on their effective date range. If I could figure out how to select the effective date range correctly, I can do the rest.
    I have data such as:
    EMP_ID DEPT_NO EFFECTIVE
    101 1000 1/15/2001
    101 1050 5/24/2005
    101 2010 6/8/2008
    101 1000 8/2/2010
    I want to write a SELECT statement that returns something like this where the END_DATE is the day before the EFFECTIVE date and the last record does not have an END_DATE because they are still assigned to that department. Also, the first record in the column, I don't want to select a DEPT_NO because the effective date logic was added in January 2001 so if a person started back in 1985 they could have switched departments zero to many times so I'm not going to update any data for that period:
    EMP_ID DEPT_NO EFFECTIVE END_DATE
    101 1/14/2001
    101 1000 1/15/2001 5/23/2005
    101 1050 5/24/2005 6/7/2008
    101 2010 6/8/2008 8/1/2010
    101 1000 8/2/2010
    Below is a script to create the data in a temp table that can be used to write a SELECT statement on. I have added two employee records with different dates.
    create table temp_activity
    (emp_id number(12),
    dept_no number(12),
    effective date);
    INSERT INTO temp_activity
    (EMP_ID,DEPT_NO,EFFECTIVE)
    VALUES
    (101,1000,to_date('1/15/2001','MM/DD/YYYY'))
    INSERT INTO temp_activity
    (EMP_ID,DEPT_NO,EFFECTIVE)
    VALUES
    (101,1050,to_date('5/24/2005','MM/DD/YYYY'))
    INSERT INTO temp_activity
    (EMP_ID,DEPT_NO,EFFECTIVE)
    VALUES
    (101,2010,to_date('6/8/2008','MM/DD/YYYY'))
    INSERT INTO temp_activity
    (EMP_ID,DEPT_NO,EFFECTIVE)
    VALUES
    (101,1000,to_date('8/2/2010','MM/DD/YYYY'))
    INSERT INTO temp_activity
    (EMP_ID,DEPT_NO,EFFECTIVE)
    VALUES
    (102,1040,to_date('1/15/2001','MM/DD/YYYY'))
    INSERT INTO temp_activity
    (EMP_ID,DEPT_NO,EFFECTIVE)
    VALUES
    (102,2000,to_date('6/16/2006','MM/DD/YYYY'))
    Any help is appreciated. This is probably easy, but I cannot get my brain wrapped around it.
    Thanks - mike

    select  emp_id,
            dept_no,
            effective,
            end_date
      from  (
              select  emp_id,
                      dept_no,
                      effective,
                      lead(effective) over(partition by emp_id order by effective) - 1 end_date,
                      row_number() over(partition by emp_id order by effective) rn
                from  temp_activity
             union all
              select  emp_id,
                      null dept_no,
                      null effective,
                      min(effective) - 1 end_date,
                      0 rn
                from  temp_activity
                group by emp_id
      order by emp_id,
               rn
        EMP_ID    DEPT_NO EFFECTIVE  END_DATE
           101                       01/14/2001
           101       1000 01/15/2001 05/23/2005
           101       1050 05/24/2005 06/07/2008
           101       2010 06/08/2008 08/01/2010
           101       1000 08/02/2010
           102                       01/14/2001
           102       1040 01/15/2001 06/15/2006
           102       2000 06/16/2006
    8 rows selected.
    SQL> SY.

  • Missing date range in select

    Hello,
    Database Version 10gr2(10.2.0.5)
    This following data set is from my query, which the date range is weekly, where two week's date is missing (that's correct, because no data for those weeks). But I need to include that week date aslso with null or 0 values on. How to I select the running weeks from the following
    Current data set
    col1     week_date
    4     04/14/2012
    6     04/21/2012
    5     05/12/2012
    10     05/19/2012
    2     05/26/2012
    Expected result set
    col1     week_date
    4     04/14/2012
    6     04/21/2012
    *0     04/28/2012*
    *0     05/05/2012*
    5     05/12/2012
    10     05/19/2012
    2     05/26/2012Any help would be greatly appreciated.
    Thanks,

    Hi,
    You can use CONNECT BY to gerenate all the dates you need, then outer join your actualdata to that result set, like this:
    VARIABLE     start_date     VARCHAR2 (20)
    VARIABLE     end_date     VARCHAR2 (20)
    EXEC  :start_date := '04/14/2012';
    EXEC  :end_date   := '05/26/2012';
    WITH     all_dates     AS
         SELECT     TO_DATE (:start_date, 'MM/DD/YYYY')     + (7 * (LEVEL - 1))     AS week_date
         FROM     dual
         CONNECT BY     LEVEL <= 1 + ( ( TO_DATE (:end_date,   'MM/DD/YYYY')
                                     - TO_DATE (:start_date, 'MM/DD/YYYY')
                             / 7
    SELECT       COUNT (x.week_date)     AS col1
    ,       a.week_date
    FROM           all_dates  a
    LEFT OUTER JOIN  table_x    x  ON  a.week_date = x.week_date
    GROUP BY  a.week_date
    ORDER BY  a.week_date
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    Edited by: Frank Kulash on May 21, 2012 5:05 PM

  • Issue with Past Month data in the Select Statement

    Hi,
    I written the following query,
    SELECT   /*+NO_MERGE(A)*/
                CASE
                   WHEN snap_shot_date > a.q3
                   AND snap_shot_date <= a.q4
                      THEN q4char
                   WHEN snap_shot_date > a.q2 AND snap_shot_date <= a.q3
                      THEN q3char
                   WHEN snap_shot_date > a.q1 AND snap_shot_date <= a.q2
                      THEN q2char
                   WHEN snap_shot_date > a.q0 AND snap_shot_date <= a.q1
                      THEN q1char              
                END snap_shot_date,
                CASE
                   WHEN snap_shot_date > a.q3 AND snap_shot_date <= a.q4
                      THEN 1
                   WHEN snap_shot_date > a.q2 AND snap_shot_date <= a.q3
                      THEN 2
                   WHEN snap_shot_date > a.q1 AND snap_shot_date <= a.q2
                      THEN 3
                   WHEN snap_shot_date > a.q0 AND snap_shot_date <= a.q1
                      THEN 4
                END sort_by,
                pillar3_exposure_class_code, pd_band_description,
                ROUND (SUM (p3.ead_post_sec_post_crm)),
                ROUND (SUM (notional_principle)),
                DECODE (SUM (notional_principle),
                        0, 0,
                        ROUND (  SUM (DECODE (exposure_type,
                                              'UNDRAW', ead_post_sec_post_crm,
                                              0
                               / SUM (notional_principle),
                               4
                DECODE (SUM (p3.ead_post_sec_post_crm),
                        0, 0,
                        ROUND (  SUM (pd_value * p3.ead_post_sec_post_crm)
                               / SUM (p3.ead_post_sec_post_crm),
                               2
                DECODE (SUM (p3.ead_post_sec_post_crm),
                        0, 0,
                        ROUND (SUM (rwa) / SUM (p3.ead_post_sec_post_crm), 4)
                DECODE (SUM (p3.ead_post_sec_post_crm),
                        0, 0,
                        ROUND (  SUM (lgd_rate * p3.ead_post_sec_post_crm)
                               / SUM (p3.ead_post_sec_post_crm),
                               2
                TO_CHAR (MAX (a.max_date), 'FMMonth DD, YYYY')
           FROM summary.pillar3 p3,
                (SELECT DISTINCT (month_end_date) max_date,
                                 LAST_DAY (month_end_date) q4,
                                 TO_CHAR (LAST_DAY (month_end_date),
                                          'MON YYYY'
                                         ) q4char,
                                 ADD_MONTHS (LAST_DAY (month_end_date), -3) q3,
                                 TO_CHAR
                                    (ADD_MONTHS (LAST_DAY (month_end_date), -3),
                                     'MON YYYY'
                                    ) q3char,
                                 ADD_MONTHS (LAST_DAY (month_end_date), -6) q2,
                                 TO_CHAR
                                    (ADD_MONTHS (LAST_DAY (month_end_date), -6),
                                     'MON YYYY'
                                    ) q2char,
                                 ADD_MONTHS (LAST_DAY (month_end_date), -9) q1,
                                 TO_CHAR
                                    (ADD_MONTHS (LAST_DAY (month_end_date), -9),
                                     'MON YYYY'
                                    ) q1char,
                                 ADD_MONTHS (LAST_DAY (month_end_date), -12) q0
                            FROM rcdwstg.stg_bcar_detail) a
          WHERE snap_shot_date BETWEEN ADD_MONTHS (a.max_date, -12) AND a.max_date
       GROUP BY CASE
                   WHEN snap_shot_date > a.q3 AND snap_shot_date <= a.q4
                      THEN q4char
                   WHEN snap_shot_date > a.q2 AND snap_shot_date <= a.q3
                      THEN q3char
                   WHEN snap_shot_date > a.q1 AND snap_shot_date <= a.q2
                      THEN q2char
                   WHEN snap_shot_date > a.q0 AND snap_shot_date <= a.q1
                      THEN q1char
                END,
                CASE
                   WHEN snap_shot_date > a.q3 AND snap_shot_date <= a.q4
                      THEN 1
                   WHEN snap_shot_date > a.q2 AND snap_shot_date <= a.q3
                      THEN 2
                   WHEN snap_shot_date > a.q1 AND snap_shot_date <= a.q2
                      THEN 3
                   WHEN snap_shot_date > a.q0 AND snap_shot_date <= a.q1
                      THEN 4
                END,
                pillar3_exposure_class_code,
                pd_band_description
       ORDER BY 2 DESC;I have written the query to get the latest 12 months data from a table and split that into 4 quarter to show in the Cognos Report. But when the table having 13th or the past months data, the select statement is showing Empty values in the first two columns and fetching the 13 month data too.
    Can anyone help me in this to avoid the problem.
    Thanks
    Radha K

    WHERE snap_shot_date BETWEEN ADD_MONTHS(TRUNC(a.max_date, 'MM'), -11) AND  a.max_date
    ....

  • Date Range Column Selection

    Hi world,
    I've encountered rather weird behavior with Numbers 2.0.3 (iWork '09, update 3 or whatever they've called it). When using the AVERAGEIFS() function, when I select a range of dates to use as a conditional, the range also selects the header cell. All the rest of my ranges (of text and numbers) do not include the header cell. Is this by some kind of design (that I'm not getting) or have I discovered a bug?
    Here is a file that demonstrates this:
    http://files.me.com/link.dupont/6wx2xe.numbers.zip

    Hello
    Most of the time, it's useful to write formulas matching the application's required syntax which is:
    AVERAGEIFS(avg-values, *test-values, condition*, test-values…, condition… )
    In your formula you wrote:
    avg-values: Data::B +is a range (the column A in table Data)+
    I don't know how you may hope to get an average of city names !
    test-values: A2 +is a single cell+
    condition: MONTHNAME(MONTH(Data::A)) +this is not a condition and the fonctions can't apply to a range+
    test-values: B1 +is a cell (must be a range)+
    condition: Data::C +is a range (the column C in table Data but it's not a condition)+
    Here:
    in Data column D the formula is:
    =MONTHNAME(MONTH(A))
    in Table 2 :: B2 the formula is:
    =AVERAGEIFS(Data::C,Data::D,"="&B$1,Data::B,"="&$A)
    Yvan KOENIG (VALLAURIS, France) mardi 6 octobre 2009 09:59:51

  • Setting default date range in selection screen when executing as batch job.

    Hi Guys,
    I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this
    Lower value = today date
    higher value= next week run date.
    How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.
    <REMOVED BY MODERATOR>
    Thanks in advance,
    Vinod.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PM

    Hi Vinod,
    Would suggest you to this.
    Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.
    Now goto create a variant from SE38 for the report.
    While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".
    Select the option "D: Dynamic date calculation" for both the date fields.
    For p_start_date - select the option "Current Date"
    For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.
    Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.
    Now, in the program, first step after START-OF-SELECTION code the following:
    RANGES: r_date FOR sy-datum.
    start-of-selection.
    refresh r_date.
    r_date-sign = 'I'. r_date-option = 'BT'.
    r_date-low = p_start_date. r_date-high = p_end_date.
    append r_date.
    Hence this way, you would have built your range and use it as needed.
    Cheers,
    Aditya

  • Ranges in select statement

    hi all,
    I want to kow how to create ranges and how to use in selet statement
    I have list of values A,B,C,D
    In select statement I have to check VBTYP not in the above range...

    Hi,
    Try this.
    INITIALIZATION.
      RANGES r_vbtyp FOR vbak-vbtyp.
    AT SELECTION-SCREEN.
      r_vbtyp-sign = 'I'.
      r_vbtyp-option = 'BT'.
      r_vbtyp-low = 'A'.
      APPEND r_vbtyp.
      r_vbtyp-sign = 'I'.
      r_vbtyp-option = 'BT'.
      r_vbtyp-low = 'B'.
      APPEND r_vbtyp.
      r_vbtyp-sign = 'I'.
      r_vbtyp-option = 'BT'.
      r_vbtyp-low = 'C'.
      APPEND r_vbtyp.
      r_vbtyp-sign = 'I'.
      r_vbtyp-option = 'BT'.
      r_vbtyp-low = 'D'.
      APPEND r_vbtyp.
    Select - - - from --
    WHERE vbtyp NOT IN r_vbtyp-low.

  • Single Date Parameter, but using a date range for selection

    Post Author: fireman204
    CA Forum: Formula
    I'm fairly new to Crystal Reports, so be gentle with me.  I have a report that has 4 parameters.  The report asks for data for a specific month, the YTD data to the end of the selected month, and the same data from the previous year.  It seems there should be a way to enter a single parameter (ie., 2007-4-1), and off that date select all the data for the month, the current year to the end of that month, and then the data from the previous year for the same period.  I know this will be a formula field needed to select the data, but not sure how to get there from here.  Any ideas?  Thanks in advance!

    Post Author: SKodidine
    CA Forum: Formula
    It should be possible for you to create just one parameter to have the user input a single date and then create formulae to create the begin and end dates for the month, YTD and PYTD.  You can then use these formulae for record selection criteria.
    For example, if the user inputs a date of 2007-04-01 for the single parameter then create formulae such as:
    beginmonth
    datevar beginmonth;
    beginmonth := date(year({?My Parameter}),month({?My Parameter}),01);
    endmonth
    datevar endmonth;
    endmonth := cdLastDayOfMonth ({?My Parameter});
    To use the cdlastdayofmonth function, In the formula workshop window, click on "Repository Custom Functions" then under CRYSTAL and DATE right click on cdlastdayofmonth and click on ADD TO REPORT.  Once that is done, then create the above "endmonth" formula.  You should see this new function in your formula workshop window in the FUNCTIONS window under CUSTOM FUNCTIONS.
    beginytd
    datevar beginytd := date(year(currentdate),01,01);
    endytd
    datevar endytd;
    endytd := cdLastDayOfMonth ({?My Parameter});
    beginpytd
    datevar beginpytd := date((year(currentdate)-1),01,01);
    endpytd
    evaluateafter({@endytd});
    datevar endytd;
    datevar endpytd;
    endpytd := date(year(endytd)-1,month(endytd),day(endytd));
    In your record selection criteria, you can use the above formulae like this:
    in {@beginmonth} to {@endmonth}
    or
    in {@beginytd} to {@endytd}
    or
    in {@beginpytd} to {@endpytd};
    This is one way of doing it, perhaps others might pitch in with a more efficient way.

  • Can I pass parameters from a dashboard via a dashboard prompt and presentation variable to publisher report based on a data model with select statements in OBIEE 11g ?

    I have a publisher 11g (v 11.1.1.7)  report with a single parameter. The report is based on a data model not a subject area.  I created a dashboard put a dashboard prompt and link to the report in separate section on the same page.  The dashboard prompt sets a presentation variable named the same as the parameter in the report. 
    The problem was when I created the dashboard prompt, it forced me to select a subject area which I did (though did not want to) and then I created both a column and variable prompts. But clicking on the
    report link completely ignored the value that I thought would be passed in the presentation variable to the report.
    Side note :  My report uses a pdf template for its layout where I have mapped the columns names from my data model to the form fields on the pdf form.  I noticed that if I create a publisher report based on a subject area, then I do not have the choice to choose a PDF as a template type for my layout.  (I only see BI Publisher Template as a choice). 
    I see some documentation online that suggest it could be done in 10g.
    Thanks
    M. Jamal

    Ok,
    I just tried that and it still doesn't pass anything to the prompt.
    I changed the prompt to an edit field and I made the following weblink but when i click the link from an account it doesn't put anything in the prompt and all data for all accounts is shown.
    This is the URL maybe I messed something up...
    https://secure-ausomx###.crmondemand.com/OnDemand/user/Dashboard?OMTHD=ShowDashboard&OMTGT=ReportIFrame&SelDashboardFrm.Dashboard Type=%2fshared%2fCompany_########_Shared_Folder%2f_portal%2f360+Report&Option=rfd&Action=Navigate&P0=1&P1=eq&P2=Account."Account Name"&P3=%%%Name%%%
    thanks

  • Formatting output from a select statement?

    Hi: a trivial question.
    When I run a select on four fields, it prints the first field in one line and the rest in the second line.
    TYPE
      PROTO CLASS_ID DSTPORT
    BUILT_INBOUND_UDP
         17    50007      53
    Is there a any variable I can configure so that all four fields are printed in the same line?
    TYPE               PROTO CLASS_ID DSTPORT
    BUILT_INBOUND_UDP 17    50007      53Thanks
    Ray

    SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
    OWNER
    SYS
    SQL> column owner format a15;
    SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
    OWNER
    SYS
    SQL> column owner format a5;
    SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
    OWNER
    SYS
    SQL>

  • Date Range on Selection Screen not working

    Hi All,
    I have a selection screen with 3 selection options on there to run a report.
    1) Today
    2) Yesterday
    3) This week
    Now the first two are working fine but number 3 This Week isn't.  Any reason why? This week basically means Monday to Friday of this week. E.g. If I have This week Clicked on Monday it would just show Mondays result, if I run this report on Wednesday with This week clicked it should show Monday, Tuesday & Wednesday.
    Regards
    Adeel
    FORM posting_date .
      CLEAR : rg_finl.
      IF rb_1 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_2 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum - 1.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_3 = 'X'.   
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'BT'.
        rg_finl-low       = sy-datum.
        rg_finl-high      = sy-datum - 7.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_4 = 'X'.
        rg_finl[] = s_budat[].
      ENDIF.
    ENDFORM.

    Hello
    You a wrong:
    Instead
    rg_finl-low = sy-datum.
    rg_finl-high = sy-datum - 7.
    you need:
    rg_finl-low = sy-datum - 7.
    rg_finl-high = sy-datum.

  • Error when selecting date range in query designer

    hi all,
    when iam trying to select date range in query designer like 01.04.2009 to 10.04.2009 it has to select only that dates where as it is selecting all the dates in between those like 010.04.2009,01.03.2009,01.02.2009.why this is happening ,iam unable to understand.plzz help me in this issue.
    Vamshi D Krishna

    hi ,
    i have created a variable as you told but no use.still i have to select the dates manuallyone after the other.for more user friendly can i have a calander where i can select date ranges.is it posible to have calander for selecting date ranges instead selecting dates one by one,if posible i request you to give  the detailed steps.plzz guide me in this issue.thanks in advance.
    Vamshi D Krishna

  • Select-options.. Date range..URgent...

    Hi All,
    Can anyone let me know.. how to give last one month date range in select options.
    Regards,
    Parvez.

    Hi,
    In the INITIALIZATION event you can do that.
    v_month = sy-datum+4(2) - 1.
    v_year = sy-datum+0(4).
    concatenate  v_year v_month 01 to v_date1
    concatenate  v_year v_month 31 to v_date2
    Or get the 1st and last dates of the last month and
    s_date-low = date1 (1st date of last month).
    s_date-sign= 'I'
    s_date-high = date2 (last date of last month).
    s_date-option = 'BT'
    append s_date.
    reward if useful
    regards,
    anji

Maybe you are looking for

  • Report field position

    hello I m using report 10g.. I want to move position of field at run time and also want to set elasticity at run time... can i do that? srw package doesnot support this. any other alternative?

  • ABAP Web Dynpro ALV - User Defined Functions

    Dear All, I don't know if my question is worth a new topic, but since I haven't found any appropriate answer by now I want you to ask the following: We're using the ALV web dynpro component to manage data and have added user functions in order to dis

  • Time Capsule support for multiple XBoxes?

    I've read many posts about how to configure Airport Extreme and Time Capsule devices to support XBox Live, but they all focus on configuring network traffic to support a single XBox by forwarding ports to a static or reserved IP address for the XBox.

  • Create test env

    Hi , I am new to this essbase aplication in my company . How do i create test env (outline , cal scripts , data etc ) from production server with same setting . Both server are already setup. For learning purposes , i want use same data / cal scripts

  • Dynamically add web part in sandbox solution

    I've site in office 365. I want to add site page in /SitePages on feature activation. I also want to dynamically add web part in this site page. How can I do this?