Date Range Selection in Query Templates

Hi,
Can someone please tell me how to use <b>Date Range Selection</b> Tab details in SQL Query and TAG Query (Using Examples).
Thanks in advance
Muzammil P.T

>>>>>>>>>>
Re: Date Range Selection in Query Templates   
Posted: Feb 15, 2007 6:43 AM    in response to: Muzammil Ahamed       Reply      E-mail this post 
Hi Muzammil,
In data range section you can have multiple options like setting start datetime and end datetime.. And you can set the shift (or) time period and also the format of the time periods.
Primarily we use the start date and end date querying to fetch data between two time labels. I can explain this one with example..
You have batch production table with columns Production Time, Batch Id, Production Qty. Then you want all the details between the 02/02/2007 to 05/02/2007.
Solution :
1.Map 02/02/2007 with Start date.
2.Map 05/02/2007 with end dare.
Now these two become the variables [SD] and [ED].
Now you have mentioned the date range, but you need to mention for which column these things to be applied. For that
3.In Query tab enter Production Time column name in Date column at the bottom.
Now you have written query like Select * from batch prodcution where production time > 02/02/2007 and production time < 05/02/2007.
4. Even those values you mapped (SD and ED) you can change from the front page through Java script.
Like wise you have so many other advantages also.
If you have any other specific doubt let me know.
Thanks,
Rajesh.
PS : Please ward points if answer is useful. <<<<<<<<
Message was edited by:
        David Dreyer

Similar Messages

  • About Date Range Selection in Contributor Recognition Program- List

    Hello SCN,
    Happy that we have a classified date range selection like Year wise, Contest period wise and also with date range in the Top Contributors list. However earlier we had a luxury to see the point classified as  "All Time Contribution".  I personally feel to get back this option as well in the list.
    Dear SDNers share your suggestion on this.
    Thanks,
    SaNv....

    Hi,
    If you want the user to select the date directly rather than entering, you need not to have a dropdown menu in WAD. Directly go to the query which you have selected for the object in WAD, there create a variable with calendar. Put it mandatory, so that the user selection of the date will be mandatory. The variable will be automatically be available when you execute the template inn the browser.
    Assign points if this helps u.
    Regards,
    Koundinya.

  • Passing the Date range within the query

    Hi ,
    In my query , I have two date characteristic, and while doing the selection I have to do selection on only one date field.
    This selection is a date range selection , So I have used a selection variable for this.
    Can anyone please let me know if it is possible to pass the selection range to other variable. Is it possible to use Customer exit to pass the complete range.
    Thanks
    Altair

    Hi,
    You can do it in the user exit.And that is the only approach to transfer the values of one variable to other variable .
    Search this forum for the code. you will find  lot of postings.
    With rgds,
    Anil Kumar Sharma .P

  • Can I use SYSDATE in the WHERE clause to limit the date range of a query

    Hi,
    Basicaly the subject title(Can I use SYSDATE in the WHERE clause to limit the date range of a query) is my question.
    Is this possible and if it is how can I use it. Do I need to join the table to DUAL?
    Thanks in advance.
    Stelios

    As previous poster said, no data is null value, no value. If you want something, you have nvl function to replace null value by an other more significative value in your query.<br>
    <br>
    Nicolas.

  • Display of 2 rows of data for 2 different date range selection

    Hi Folks,
    I have a requirement as follows,
    User has an option of selecting 2 Date Ranges
    From and To Date and again From and To Date
    The result should display 2 different rows of data with From and To Date range selection.
    Eg:
    12/09/20008 to 03/09/2009           10 20 30 40
    23/10/2009 to  18/12/2010           40 20 10 30
    Difference                                   30 0  20 10
    % Change                                   x  y  z   q
    Thanks for your input.
    Regards,
    KJ

    You will need to use union report, and you would have fours union's in this report.
    Union - 1: Data from 1st Date Range
    Union - 2: Data from 2nd Date Range
    Union - 3: Variance Calculation
    Union - 4: Percentage Variance Calculation.
    If the date's are coming from the same field, use cast function to use the same column twice in your prompts. Apply filters on each union as needed.
    Thanks.

  • How to use 2 Dropdown box in webapplication for date range selection

    Dear all,
    I am working on a report that will show 2 drop down boxes. These should be used as a date range.
    This works fine if I use 2 variables as a date range on 0CALYEAR. However I dont want the user to fill in the dates but selecting the dates with 2 drop down boxes.
    I cannot manage to get this to work. I saw some comments about user exits in the forum but I cannot figure it out if there is an easier way.
    Could you give me an idea of what to do?
    Thanks a lot,
    Andreas

    Hi,
    If you want the user to select the date directly rather than entering, you need not to have a dropdown menu in WAD. Directly go to the query which you have selected for the object in WAD, there create a variable with calendar. Put it mandatory, so that the user selection of the date will be mandatory. The variable will be automatically be available when you execute the template inn the browser.
    Assign points if this helps u.
    Regards,
    Koundinya.

  • Date Range Selection

    Dear friends,
    How to select the record from BSEG table between Date range. Please give me the solution . Am also try to find the solution in SDN also.
    select-options post_dt for bkpf-budat obligatory default sy-datum NO-EXTENSION.
    select belnr budat from bkpf into corresponding fields of table it_head
        where bukrs eq compcode
        and gjahr eq year
        and blart eq doctype
        and budat in post_dt
        order by belnr budat.
    For this select query is working in perfect for single date only. But i want to select the date date range wise.
    Thanks
    Saravanan R

    HI,
           U can check the Select Quert by using IN s_option.
    Like eg:--
        Select * form Zemp where empno in s_empno.
    Hope this example will help u...
    here Zemp is a table...... empno is a field     s_empno is a Select-option.
    Thanks and rEgards
    Suraj S Nair

  • Drop Down Box for Date Range Selection

    I have multiple queries on the same worksheet with different variables for each.  To simplify changing the one consistent variable, the date range, I have added a drop down box tied to all infoproviders in the query.  This would work if I wanted to select a single date but I cannot determiine how to select a date range (01/2010 - 12/2010).  Any ideas on how I might accomplish this?  I am using Netweaver 7.1.

    You can use two single-input variables: one for DATE FROM and the other for DATE TO and use them in query definition to restrict the date (restriction type: Range between DATE FROM and DATE TO).
    Then you create two dropdown boxes, one for each variable.
    Regards,
    Dorota

  • Date range select

    Hello
    i have a table with records
    id number , start_date date , end_date date .
    I want to select all ids that are with in an acceptable date range
    ex. table data ( mm/dd/yyyy)
    1 , 1/1/2008 , 1/4/2008
    2. 1/3/2008 , 1/10/2008
    3 1/12/2008 , 1/15/2008
    4 1/4/2008 , 1/8/2008
    5 1/5/2008 , 1/6/2008
    i want to find all ids that the dates between 1/3/2008 and 1/4/2008
    exists in their date range
    acceptable record ids are 1 ,2 and 4
    Thank you

    i want to find all ids that the dates between 1/3/2008 and 1/4/2008
    select id from your_table
    where start_date <= to_date('1/4/2008')
    and end_date >= to_date('1/3/2008')Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • User Prompt for Date Range in Bex Query Analyzer

    I have a workbook that has two queries. The queries both require the user to enter a date range upon refresh. I want the user to be able to hit refresh, enter the date input into the dialog box and then both queries to use this date range for their input. I have seen this in other book, but when I click refresh on my book it only runs the first query. How do I get the second query to use the first queries input?

    use the same variable in both the queries. this will let the user enter the date in a single variable and this will refresh both the queries.
    rgds, Ghuru

  • Opendoc date range into Bex query

    We are having an issue when trying to pass a date range in an Opendoc link. The report is built off a BEx query,  within the report we have an Opendoc link into a child version of the report. I can pass all the other prompts with no issue except for one which is the date range.
    I am defining the date range as "[19000101]..[19000101]" but we keep getting this error message:
    Has anyone lese had this issue?
    Thanks

    Hi,
    Try This
    "[Date(2014,04,01)]..[Date(2014,04,11)]"
    "[Date(yyyy,MM,dd)]..[Date(yyyy,MM,dd)]"
    http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_opendocument_en.pdf#page=26
    http://<servername>:<port>/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Aa6GrrM79cRAmaOSMGoadKI&sID
    Type=CUID&sRefresh=Y&lsRTime+Period:=[2000..2004)
    http://<servername>:<port>/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Aa6GrrM79cRAmaOSMGoadKI&sID
    Type=CUID&sRefresh=Y&lsRparamStringDR=[h..i]&lsRparamNumberDR=[7..8]&lsRparamCurrencyDR=[3..4]&lsRparamDat
    eDR=[Date(2003,6,7)..Date(2003,6,8)]&lsRparamDateTimeDR=[DateTime(2003,6,1,7,1,1)..Date
    Time(2003,6,1,8,1,1)]&lsRparamTimeDR=[Time(1,1,7)..Time(1,1,8)]&lsRparamUnbound1=(..6)&lsRpara
    mUnbound2=[6..)&lsRparamStringR=[a..d]&lsRparamNumberR=[1..3]&lsRparamCurrencyR=[1..3]&lsRparam

  • Date range selection from session/server variables - possible solution

    I've recently been creating some reports who'se selection is based on the contents of a session variable, using this against a date field. Thought I'd share with everyone how I did it.
    1/ Create a server/static variable called DATE_FORMAT who'se contents are 'dd/mm/yy' . Note, should include the single quotes.
    2/ Create 2 session variables that represent the beginning/end date range for your selection you are after - in my case, it was the first & last date of the previous month, PREVIOUS_PERIOD_FROM and PREVIOUS_PERIOD_TO
    3/ In the selection, add a filter on the date field in question, set the Operator as "is between".
    4/ for each of the 2 valaues, select Add->SQL expression and enter:
    EVALUATE('TO_DATE(%1,%2)',VALUEOF(NQ_SESSION."PREVIOUS_PERIOD_FROM"),VALUEOF("DATE_FORMAT"))
    and
    EVALUATE('TO_DATE(%1,%2)',VALUEOF(NQ_SESSION."PREVIOUS_PERIOD_TO"),VALUEOF("DATE_FORMAT"))

    HI,
           U can check the Select Quert by using IN s_option.
    Like eg:--
        Select * form Zemp where empno in s_empno.
    Hope this example will help u...
    here Zemp is a table...... empno is a field     s_empno is a Select-option.
    Thanks and rEgards
    Suraj S Nair

  • Date range selection in abap code in infopackage

    Hi!
    I have a field called "OPEN_DATE".
    When the infopackage is runned, I need the abap code to fint the current date, and from that, make a date range from the first day of current month to the last day of current month
    Ex:
    Current date = 12.12.2008
    Abap code should extract 01.12.2008 - 31.12.2008
    Thanks!

    Hi helge,
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum,
             date_high like sy-datum.
    Date_low = sy-datum.
    date_low+6(2) = '01'.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
      EXPORTING
        DAY_IN                  = Date_low
    IMPORTING
       LAST_DAY_OF_MONTH       = date_high
    read table l_t_range with key
    fieldname = 'OPEN_DATE'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move date_high to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    Regards,

  • Date Range: Select which Qtr a date falls into

    Hi All
    I am looking for some code that takes a date passed into a variable and calculates which Quarter it is in.
    My client uses Quarters:
    Feb - Apr (Q1)
    May - Jul (Q2)
    Aug - Oct (Q3)
    Nov - Jan (Q4)
    So, if I pass a date of 21-Mar-2007 into the Variable, the code takes the date, calculates that the date is in Q1 and then returns the date of 200702 (the YEAR/ MONTH of the First Month in the Quarter) into the BW report.
    I have searched the forums and can't find anything that would work, so you help is much appreciated.
    DG

    Hi Ajay
    Thanks very much for your response.
    I'm having a few difficulties getting the code to work in our environment, so was hoping you could help me tune it.
    Input is Current Month
    Output is First Month of Current Quarter
    So, using this code, how can I pass the input date into the code?
    (I'm sorry if this is obvious, I'm really new to SAP Development, so the answer may be and most probably is really obvious)

  • Date range query  problem  in report

    Hi all,
    I have created a report based on query and i want to put date range selection but query giving problem.
    If i am creating select list selection then it is working fine means it will display all records on the particular date.
    But what i need is that user will enter date range as creation_date1,creation_date2 and query should return all the records between these date range. i want to pass it by creating items, i created two items and passing creation_date range to display all records but not displaying and if not passing date then should take null as default and display all records
    Here is the query:
    /* Formatted on 2006/12/10 20:01 (Formatter Plus v4.8.0) */
    SELECT tsh."SR_HEADER_ID", tsh."SALES_DEPT_NUMBER", tsh."COUNTRY",
    tsh."LOCAL_REPORT_NUMBER", tsh."ISSUE_DATE", tsh."SUBJECT",
    tsh."MACHINE_SERIAL_NUMBER", tsh."MACHINE_TYPE", tsh."MACHINE_HOURS",
    tsh."STATUS"
    FROM "TRX_SR_HEADERS" tsh, "TRX_SR_PARTS" tsp
    WHERE (tsh.status LIKE :p23_status_sp OR tsh.status IS NULL)
    AND (tsh.machine_type LIKE :p23_machine_type_sp)
    AND ( tsh.machine_serial_number LIKE
    TO_CHAR (:p23_machine_serial_number_sp)
    OR tsh.machine_serial_number IS NULL
    AND ( TO_CHAR (tsh.failure_date, 'DD-MON-YY') LIKE
    TO_CHAR (:p23_failure_date_sp)
    OR TO_CHAR (tsh.failure_date, 'DD-MON-YY') IS NULL
    AND ( TO_CHAR (tsh.creation_date, 'DD-MON-YY')
    BETWEEN TO_CHAR (:p23_creation_date_sp)
    AND TO_CHAR (:p23_creation_date_sp1)
    OR TO_CHAR (tsh.creation_date, 'DD-MON-YY') IS NULL
    AND (tsh.issue_date LIKE :p23_date_of_issue_sp OR tsh.issue_date IS NULL)
    AND (tsh.country LIKE :p23_country_sp OR tsh.country IS NULL)
    AND ( tsh.local_report_number LIKE TO_CHAR (:p23_local_rep_num_sp)
    OR tsh.local_report_number IS NULL
    AND ( tsp.part_number LIKE TO_CHAR (:p23_part_number_sp)
    OR tsp.part_number IS NULL
    AND tsh.machine_type IN (
    SELECT DISTINCT machine_type
    FROM trx_sales_dept_machine_list
    WHERE sales_department_id IN (
    SELECT DISTINCT sales_department_id
    FROM trx_user_sales_department
    WHERE UPPER (user_name) =
    UPPER ('&APP_USER.'))
    AND SYSDATE >= valid_from)
    AND tsh.sr_header_id = tsp.sr_header_id
    can any one tell me wat is wroung in this query.
    Any other way to write this?
    Thank You,
    Amit

    Hi User....
    Here is some date range SQL that my teams uses with some success:
    For date columns that do not contain NULL values, try this (note the TRUNC, it might help with your "today" problem).
    The hard coded dates allow users to leave the FROM and TO dates blank and still get sensible results (ie a blank TO date field asks for all dates in the future.
    AND TRUNC(DATE_IN_DATABASE)
    BETWEEN
    decode( :P1_DATE_FROM,
    TO_DATE('01-JAN-1900'),
    :P1_DATE_FROM)
    AND
    decode( :P1_DATE_TO,
    TO_DATE('31-DEC-3000'),:
    :P1_DATE_TO)
    For date columns that contain NULL values, try this (a little bit trickier):
    AND nvl(TRUNC(DATE_IN_DATABASE),
    decode( :P1_DATE_FROM,
    decode( :P1_DATE_TO,
    TO_DATE('30-DEC-3000'),
    NULL),
    NULL)
    BETWEEN
    decode( :P1_DATE_FROM,
    TO_DATE('01-JAN-1900'),
    :P1_DATE_FROM)
    AND
    decode( :P1_DATE_TO,
    TO_DATE('31-DEC-3000'),
    :P1_DATE_TO)
    Note the 30-DEC-3000 versus 31-DEC-3000. This trick returns the NULL dates when the FROM and TO date range items are both blank.
    I hope this helps.
    By the way, does anyone have a better way of doing this? The requirement is given a date column in a database and a FROM and a TO date item on a page,
    find all of the dates in the database between the FROM and TO dates. If the FROM date is blank, assume the user want all dates in the past (excluding NULL dates). If the TO date is blank, assume that the user wants all of the dates in the future (excluding NULL dates). If both FROM and TO dates are blank, return all of the dates in the databse (including NULL dates).
    Cheers,
    Patrick

Maybe you are looking for

  • How do I install Leopard on my g4?

    Can't get Leopard to install on my G4. Everything seems to be in order, but when it tells me to choose a location for the installation, there are no locations to select from. There are over 10 GB of free space available. Machine Name: iMac Machine Mo

  • New User Database schema and table name

    When i create a new user in Oracle Webcenter Spaces 11g, I am not able to get the name of the database schema and table, where it is stored. Any insight on this will be very helpful.

  • Wont install some 64bit programs

    why do I keep having this problem - I just bought this and again it wont work!

  • Reg:-ORIGINAL PROMISE DATE OF PO

    Hi all, We have bulit a report on Purchase Order Receipts. In that we are having three columns i.e. Current Promise Date, Need by Date, Original Promise Date. NOW – the problem is that the ORIGINAL PROMISE date is not accurate when there is multiple

  • Left Arrow Key Closes during Rename

    Has anybody else noticed sometimes that when you're renaming a file and using the left arrow key to move through the text, the Finder closes the editability of that file name? As you proceed to use the left arrow key, it would close subfolder after s