Visual Composer: Date Range in Query

Hi,
While working in Visual Composer, I have come across the need to re-use the same query 20 times, but with slightly different date ranges. One way would be to create 20 copies of the same query and change the selection dates as needed on each of them. However, is it possible to provide date ranges in a query in Visual Composer? Right now its only letting me enter single values.
Thanks
Adeel

Problem can be resolved by using a colon between the dates. Furthermore, the DSTR function in the expression editor can be used to form the desired dates.

Similar Messages

  • 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

  • Date Range in Query

    Hi All,
    We have created a query report which we have created as a stored procedure and we are executing the sp in SBO to get the result. However, there is one issue, we have passed the variables in the sp as well as the fms to get the date range, but if we input the date manually, the result shown is incorrect!!
    It works fine when we tab on the from date, scroll down and select the date from the cfl!! This is not acceptable to the client. They want to enter the dates manually and not select from the cfl.
    Please advise what is wrong here and how to correct this issue?? Is there any limitation of this sort..
    Thanks,
    Joseph

    Hi Joseph,
    Instead of getting the date as string, try by changing the below declaration part
    Declare @datefrom VARCHAR(20)
    DECLARE @dateto VARCHAR(20)
    by this
    Declare @datefrom datetime
    DECLARE @dateto datetime
    I think, then you need to chenge the same in the SP too
    Regards,
    Bala

  • Date range in query keydate

    Hi,
    Is the keydate in query accepts the date range, from the query properties keydate accepts one date.  I also tried from variable customer exit  it is giving an error shown below.
    EError for variable  in customer enhancement <variable name>                      
    EVariables contain invalid values.                                       
    I>> Row: 82 Inc: LRRMSU13 Prog: SAPLRRMS                                 
    ASystem error in program CL_RSR_OLAP_VAR and form INIT-02- (see long text)
    The requirement is to display multiple records from master data (the time dependent master data in the given data range) based on the keydate range provided. 
    Please respond how to resolve this.
    Thanks
    Sreedh.

    Hi Shalabh,
    Here is the output i'm looking for
    Time dependent Master data 
    Emp1           date  from         date to               Attr1          Attr2
    ABCD           01/01/2008        02/29/2008        Name1       Name2
    ABCD           03/01/2008        05/31/2008        Name3       Name4
    In query when the key date is >= 01/01/2008, the trsn data will show as
    Emp1   Attr1     Attr2       Keyfig
    ABCD  Name1  Name2    
    ABCD  Name3  Name4    30
    The keydate for the query is not accepting the range, is there anyway to achieve this.   Don't want to use the Infoset. 
    Thanks
    Sreedh

  • Discoverer Date Range Union Query

    Hi All,
    I need your help in creating a discovere report in version 11G.
    Following Report find missing elimination account based on Transaction done in a date Range. Find out how many accounts are not defined in Elimination Account Setup. Following query gives me desired output but i am having hard time creating a discoverer report for Date Range Parameter as Date Range only applied to one side of union.
    In First Query i used decode with sysdate itself so that i can use effective_date as parameter and second side i just kept sysdate.
    PLease let me know how can i create a parameterized report for effective_date range.
    SELECT
        /*+ ORDERED
        USE_NL(jel jeh jeb cat src)
        INDEX(jel GL_JE_LINES_N1)
        INDEX(jeh GL_JE_HEADERS_U1)
        INDEX(jeb GL_JE_BATCHES_U1)
        INDEX(cat GL_JE_CATEGORIES_TL_U1)
        INDEX(src GL_JE_SOURCES_TL_U1) */
        CC.SEGMENT1
        ||'.'
        ||CC.segment2
        ||'.'
        ||CC.segment3
        ||'.'
        ||cc.segment4
        ||'.'
        || cc.segment5
        ||'.'
        || cc.segment6 Account,
        decode(sysdate,sysdate,sysdate,jel.effective_date) trx_date
      FROM gl_code_combinations cc,
        gl_je_lines jel,
        gl_je_headers jeh,
        gl_je_batches jeb,
        gl_je_categories cat,
        gl_je_sources src
      WHERE cc.CHART_OF_ACCOUNTS_ID = 50308
      AND cc.segment2              IN ('111710','201910')
      AND jel.code_combination_id   = cc.code_combination_id
      AND jel.status
        || ''                = 'P'
      AND (jel.accounted_cr != 0
      OR jel.accounted_dr   != 0)
      AND jeh.je_header_id   = jel.je_header_id
      AND jeh.actual_flag    = 'A'
      AND jeh.currency_code       != 'STAT'
      AND jeb.je_batch_id          = jeh.je_batch_id
      AND jeb.average_journal_flag = 'N'
      AND src.je_source_name       = jeh.je_source
      AND cat.je_category_name     = jeh.je_category
      and jel.effective_date between to_date('01-JAN-2011','DD-MON-RRRR') and to_date('31-MAY-2011','DD-MON-RRRR')
      MINUS
      SELECT (source_segment1
        ||'.'
        ||source_segment2
        ||'.'
        ||source_segment3
        ||'.'
        ||source_segment4
        ||'.'
        ||source_segment5
        ||'.'
        ||source_segment6) def_acnt,
        sysdate
      FROM GL_ELIM_ACCOUNTS_MAP

    Hi,
    You can use the following SQL to get the effective date into the SQL and by that create the condition in the report:
    SELECT
    CC.SEGMENT1
    ||'.'
    ||CC.segment2
    ||'.'
    ||CC.segment3
    ||'.'
    ||cc.segment4
    ||'.'
    || cc.segment5
    ||'.'
    || cc.segment6 Account,
    decode(sysdate,sysdate,sysdate,jel.effective_date) trx_date,
    jel.effective_date
    FROM gl_code_combinations cc,
    gl_je_lines jel,
    gl_je_headers jeh,
    gl_je_batches jeb,
    gl_je_categories cat,
    gl_je_sources src
    WHERE cc.CHART_OF_ACCOUNTS_ID = 50308
    AND cc.segment2 IN ('111710','201910')
    AND jel.code_combination_id = cc.code_combination_id
    AND jel.status
    || '' = 'P'
    AND (jel.accounted_cr != 0
    OR jel.accounted_dr != 0)
    AND jeh.je_header_id = jel.je_header_id
    AND jeh.actual_flag = 'A'
    AND jeh.currency_code != 'STAT'
    AND jeb.je_batch_id = jeh.je_batch_id
    AND jeb.average_journal_flag = 'N'
    AND src.je_source_name = jeh.je_source
    AND cat.je_category_name = jeh.je_category
    AND NOT EXISTS (
    SELECT 1
    FROM GL_ELIM_ACCOUNTS_MAP
    WHERE CC.SEGMENT1 = source_segment1
    AND CC.segment2 = source_segment2
    AND CC.segment3 = source_segment3
    AND cc.segment4 = source_segment4
    AND cc.segment5 = source_segment5
    AND cc.segment6 = source_segment6
    AND decode(sysdate,sysdate,sysdate,jel.effective_date) = SYSDATE
    *** I removed the hints, but if you need those get them back
    *** BTW i didn't understand the logic behind the "decode(sysdate,sysdate,sysdate,jel.effective_date)" wouldn't it always be SYSDATE???
    Tamir

  • Date range related query needed

    I have table 'ratemast' with following columns and data
    begindate      enddate           rate1
    01-12-2006      10-12-2006     750.00
    11-12-2006      25-12-2006     950.00
    26-12-2006      02-03-2007     1500.00
    the data in begindate and enddate may fall between any date range.
    it may be for a week or for a month or even more than that.
    i need a query to do the following:
    my query will have begindate and enddate for any date range which is not defined in a single row of ratemast.
    I need to pick indiviudal date and its respective rate and sum them and it should be divided by number of days.
    eg:- if begindate: 09-12-2006 enddate: 13-12-2006
    result should be : (750+750+950+950+950)/5
    Please help.

    Hi,
    Here's one way... you may have to alter it to check for count(*) = 0 or any other corner cases.
    [email protected](152)> create table ratemast(begindate date, enddate date, rate number);
    Table created.
    Elapsed: 00:00:00.22
    [email protected](152)> insert into ratemast(begindate, enddate, rate)
    values (date '2006-12-01', date '2006-12-10', 750);
    1 row created.
    Elapsed: 00:00:00.01
    [email protected](152)> insert into ratemast(begindate, enddate, rate)
    values (date '2006-12-11', date '2006-12-25', 950);
    1 row created.
    Elapsed: 00:00:00.00
    [email protected](152)> insert into ratemast(begindate, enddate, rate)
    values (date '2006-12-26', date '2007-03-02', 1500);
    1 row created.
    Elapsed: 00:00:00.00
    [email protected](152)> commit;
    Commit complete.
    Elapsed: 00:00:00.04
    [email protected](152)> select * from ratemast
      2  /
    BEGINDATE ENDDATE         RATE
    01-DEC-06 10-DEC-06        750
    11-DEC-06 25-DEC-06        950
    26-DEC-06 02-MAR-07       1500
    Elapsed: 00:00:00.03
    [email protected](152)> var begin_date varchar2(10);
    [email protected](152)> var end_date varchar2(10);
    [email protected](152)> exec :begin_date := '2006-12-09';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    [email protected](152)> exec :end_date := '2006-12-13';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    [email protected](152)> @ed
    Wrote file TEST.BRANDT_152_20070315150352.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select dates.d
      7  , r.rate
      8  from dates
      9  , ratemast r
    10* where dates.d between r.begindate and r.enddate
    [email protected](152)> /
    D               RATE
    09-DEC-06        750
    10-DEC-06        750
    11-DEC-06        950
    12-DEC-06        950
    13-DEC-06        950
    Elapsed: 00:00:00.02
    [email protected](152)> ed
    Wrote file TEST.BRANDT_152_20070315150352.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select :begin_date
      7  , :end_date
      8  , avg(r.rate) as fee
      9  from dates
    10  , ratemast r
    11  where dates.d between r.begindate and r.enddate
    12* group by :begin_date
    [email protected](152)> /
    :BEGIN_DATE                      :END_DATE                               FEE
    2006-12-09                       2006-12-13                              870
    Elapsed: 00:00:00.01
    [email protected](152)> exec :end_date := '2007-01-15';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    [email protected](152)> @ed
    Wrote file TEST.BRANDT_152_20070315151840.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select dates.d
      7  , r.rate
      8  from dates
      9  , ratemast r
    10* where dates.d between r.begindate and r.enddate
    [email protected](152)> /
    D               RATE
    09-DEC-06        750
    10-DEC-06        750
    11-DEC-06        950
    12-DEC-06        950
    13-DEC-06        950
    14-DEC-06        950
    15-DEC-06        950
    16-DEC-06        950
    17-DEC-06        950
    18-DEC-06        950
    19-DEC-06        950
    20-DEC-06        950
    21-DEC-06        950
    22-DEC-06        950
    23-DEC-06        950
    24-DEC-06        950
    25-DEC-06        950
    26-DEC-06       1500
    27-DEC-06       1500
    28-DEC-06       1500
    29-DEC-06       1500
    30-DEC-06       1500
    31-DEC-06       1500
    01-JAN-07       1500
    02-JAN-07       1500
    03-JAN-07       1500
    04-JAN-07       1500
    05-JAN-07       1500
    06-JAN-07       1500
    07-JAN-07       1500
    08-JAN-07       1500
    09-JAN-07       1500
    10-JAN-07       1500
    11-JAN-07       1500
    12-JAN-07       1500
    13-JAN-07       1500
    14-JAN-07       1500
    15-JAN-07       1500
    38 rows selected.
    Elapsed: 00:00:00.01
    [email protected](152)> ed
    Wrote file TEST.BRANDT_152_20070315150352.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select :begin_date
      7  , :end_date
      8  , avg(r.rate) as fee
      9  from dates
    10  , ratemast r
    11  where dates.d between r.begindate and r.enddate
    12* group by :begin_date
    [email protected](152)> /
    :BEGIN_DATE                      :END_DATE                               FEE
    2006-12-09                       2007-01-15                       1243.42105
    Elapsed: 00:00:00.01
    [email protected](152)> cheers,
    Anthony

  • Breaking Date Range in Query...

    Hi Friends,
    I have a Table which calculates Leaves taken by employees. The Leave Start date and End Date is in Range. i.e. Leave is from say 10th March 2006 to 15th March 2006. I need to generate a report for each day of the Leave. I.e. report needs a record for 10th, 11th,12th,13th,14th,15th. How can I break the date range into individual dates betn that range in a SQL Query..?
    thanks a lot,
    Jalpan Pota

    You can do it with a pipelined function. I have posted Re: Quarters Missing.?? that produces a range of quarters for a given date range. You should be easily able to amend this so that it produces a range of dates. Note that you will need to create a type that is a nested table of dates.
    Cheers, APC

  • Visual composer + data master

    Hello!!
    I need to use visual composer for  that the user can update the master data,
    I need information for this, can somebody to say to me some link, or some documentation???
    Very thanks

    Very thank
    Your help has been very good

  • Date range windowing query...I think

    Trying to do something I've not done before perhaps you can help or point me in the right direction.
    I've got a simple table with events, something like name, start_date, end_date. These events can be duplicates, they can be distinct, they can have the same start_date and different names, or they can have the same name and start_date but different end_dates - any kind of overlap is allowed. There can also be gaps in the events where there is no event that covers a particular date. Really the only thing I can count on is that none of the values will be null. Basically a mess, as far as determining into which event's start-end date range a particular date falls, when there is overlap. However, that's what I need to do. The other wrinkle is that it's okay for me to ignore the end date of an event, for the purposes of gap-filling. That is to say, if there is no event that covers Jun 1, 2010, then I can 'choose' the event that ends prior to Jun 1, 2010.
    I would like to, assuming some analytic function magic that I don't have, take this table and produce another that recomputes the start and end dates so that there is no overlap and the gaps are filled. As an overly simplistic example, given the input:
    name start end
    foo1 jan 1 jan 31
    foo2 jan 15 jan 31
    foo3 mar 1 mar 30
    it would generate
    foo1 jan 1 feb 28
    foo3 mar 1 mar 30
    or, alternatively
    foo1 jan 1 jan 14
    foo2 jan 15 feb 28
    foo3 mar 1 mar 30
    almost any reasonable elimination of overlaps is okay, so long as it makes sense. Are there any of the analytic functions that make this less painful?

    I'm not sure what the PK of your table is and how "funny" the data can get, but your second result can be got by this:
    create table test1 (
    name varchar2(10),
    startd date,
    endd date);
    insert into test1 values('foo1', to_date('20100101','yyyymmdd'),to_date('20100131','yyyymmdd'));
    insert into test1 values('foo2', to_date('20100115','yyyymmdd'),to_date('20100131','yyyymmdd'));
    insert into test1 values('foo3', to_date('20100301','yyyymmdd'),to_date('20100330','yyyymmdd'));
    commit;
    select name,to_char(startd,'mon dd') startd,
    to_char(lead(startd -1,1,endd) over (order by startd),'mon dd')endd
    from test1
    order by startd;
    or, alternatively
    foo1 jan 1 jan 14
    foo2 jan 15 feb 28
    foo3 mar 1 mar 30foo1     jan 01     jan 14
    foo2     jan 15     feb 28
    foo3     mar 01     mar 30
    - andy

  • Need to specify date range for query result.

    Below is my query. The query as is is working fine. The columns 'totalCalls' , 'totalOrders' and 'totalSCs' are all stored by date. I have created a form where the user can specify a start and end date. How would I change this query to report within those specified dates.
    <cfquery name="qZVPData_Western" datasource="xxxxxx">
    SELECT UserID,
           TMName,
        UserZone,
        AVG(WeekCallGoal) AS WCG,
        AVG(QTCallGoal) AS QTCG,
              (SELECT COUNT(*)
               FROM Sales_Calls
               WHERE Sales_Calls.UserID = u.UserID) as totalCalls,
        (SELECT COUNT(*)
         FROM Orders
         WHERE Orders.UserID = u.UserID) as totalOrders,
        (SELECT SUM(Quantity)
         FROM ProductOrders PO
         WHERE PO.UserID = u.UserID AND PO.NewExisting = 1) as newItems,
        (SELECT SUM(NewExisting)
         FROM  ProductOrders PO_
         WHERE PO_.UserID = u.UserID) as totalNew,
        (SELECT COUNT(ServiceCall_ID)
         FROM  ServiceCalls SC
         WHERE SC.UserID = u.UserID) as totalSCs,
        (SELECT COUNT(UserID)
         FROM  TMStatusLog TSL
         WHERE TSL.UserID = u.UserID AND TSL.Status = 'Vacation') as TSLdays1,
        (SELECT COUNT(UserID)
         FROM  TMStatusLog TSL
         WHERE TSL.UserID = u.UserID AND TSL.Status = 'TradeShow') as TSLdays2,
        (SELECT COUNT(UserID)
         FROM  TMStatusLog TSL
         WHERE TSL.UserID = u.UserID AND TSL.Status = 'Admin Day') as TSLdays3,  
        SUM(TSLdays1)+(TSLdays2)+(TSLdays3) AS TSLdays,   
        SUM(totalOrders)/(totalCalls) AS closePerc,
        SUM(totalOrders)/(totalCalls) - (.30) AS GRV,
        SUM(totalSCs)+(totalCalls)-(QTCG) AS PerVar,
       (SUM(totalSCs) + totalCalls + (TSLdays*WCG/5))/QTCG AS PerCalls
    FROM Users u
    WHERE UserZone = 'Western'
    GROUP BY UserZone, UserID, TMName
    </cfquery>
    I figured I could add this to the columns WHERE statements;
    'AND Column BETWEEN #FORM.Start# AND #FORM.End#' but this isn't working.
    Any ideas???

    What is the SQL being generated by your <cfquery> contents?  Is it valid SQL?  This is always the first thing to check when you get SQL errors back from the DB... check what you're sending to the DB.
    Second: don't hard-code dynamic values into your SQL string, pass them as parameters.
    Re all the subqueries: it runs fine in dev. Have you tried to load test it?  If poss move your subqueries to the FROM statement, as then they're only run once per recordset. As opposed to once per row of the result set, when the subqueries are in the SELECT or WHERE statement.
    Adam

  • SQL Syntax for hour/date range in Query

    Hi
    I am trying to set up an query for sales order documents procesed in the last 30 minutes to be set as an alert to be run every 30 minutes to the sales manager.  I am having difficulty getting the syntax for the last 30 minutes
    Any suggestions?
    David

    hi,
    I'm not sure query is correct,but u can modify it futher to get correct one.
    SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.DocTotal FROM ORDR T0 WHERE DateDiff(dd, T0.DocDate ,getdate()) = 0 and
    DateDiff(Minute,T0.DocTime,' ') <= 30
    Jeyakanthan

  • Input date range on Query

    Hi Experts,
    I have a query that a client want as a Dashboard report. For this report to work in the Add-on, I cannot speficy it like this:
    T1.RefDate >= [%0] AND T1.RefDate <= [%1]
    Here is the Query they need this for:
    SELECT SUM(T0.SYSDeb - T0.SYSCred) AS 'Production'
    FROM JDT1 T0
    WHERE T0.Account in ('_SYS00000000238','_SYS00000000239','_SYS00000000244')
    UNION
    SELECT SUM(T0.SYSDeb - T0.SYSCred) AS 'Production'
    FROM JDT1 T0
    WHERE T0.Account = '_SYS00000000053'
    They want this to display for the curent month and have another that shows this for the past month.
    Any help would be appreciated.
    Marli

    Hi Marli,
    Try this for current month:
    SELECT SUM(T0.SYSDeb - T0.SYSCred) AS 'Production'
    FROM dbo.JDT1 T0
    WHERE T0.Account in ('_SYS00000000238','_SYS00000000239','_SYS00000000244',  '_SYS00000000053') AND
    MONTH(T0.RefDate)=Month(Getdate()) AND YEAR(T0.RefDate)=YEAR(Getdate()) 
    For last month, you just need change to MONTH(T0.RefDate)=Month(Getdate())-1
    Thanks,
    Gordon

  • BI SAP Query Connector Heatmap Error - Empty display in Visual composer

    Hi,
    I am trying to create an Heatmap iview in SAP Visual Composer using BI SAP Query Connector.
    While using the Heatmap template, we are able to see the data but finally when we deploy  and run the iview we see empty screen.
    Any inputs is highly appreciated.
    Regards,
    Sreeram

    Hi,
    thanks for your time and help. Its a relevant blog but unfortunately doesnot solve my problem.
    I am using BI SAP Query Connector system instead of BI JDBC. While creating the Heatmap I am able to select the fields and see the output in table format, but finally the chart is not appearing. its blank.
    IGS is configured correctly, able to reach backend to select tables, select fields. After deployment and when the ivew is run I dont even see any heatmap, but a blank container.
    Please suggest if you have any clues regarding this.
    Regards,
    Sreeram

  • Require query in Visual composer

    Hi,
        I want to call below query in Visual composer.
          1) SAP query from R/3 server 
          2) BEX query from BW server.
              I am able to see BAPI/RFC from R/3 server but not query. Do we require any additional thing with VC to call those queries?
                        I have heard about connecter, When we install VC it comes with that or we need to add connecter explicitly to call query. If yes then what I need to do. Let me know it’s urgent.

    Hi Sachin,
    I'm sorry for the delay. SDN had some problems the last minutes..
    Here the link to the weblog, helping you to set up both systems:
    <a href="/people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer">/people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer</a>
    Best Regards, Benni

  • Date Range Parameter's Restriction

    Could you someone please tell me how BO restricts date range parameter when the users tries to run a query?  Often times, users simultaneously try to get several years of data dumped into a single query.  Some users even forget to enforce the date range, which causes the query to try to get the data from the beginning of time. 
    How do we as a BO developer create some sort of date range restriction so that it can prevent users from overloading a query?  If the users want to get several years of data, he/she has to run a query in batches instead of doing it all at once.
    I hope there is a way that we can create a custom informational error message for each report to prevent users from trying to query too many months or years of data.  Some reports may hit small and well-indexed tables that allow large date range queries.  But, some reports query against large and poorly indexed tables, which can potentially cause adverse effect on performance without date range restriction. 
    Any thoughts or advices on how to implement such things (if possible).  I am also afraid that the answer will be "currently not doable".  If so, any ideas if the next version of BO will allow such functionality, or if it is at least in the plan at all?  Thank you so much for your insight and sharing.  Have a great day!

    Dear Amr,
    Thanks so much for your quick reply!  The field I want to create a restriction on is called RESULT_DT_TM.  When I saw the "where" section of the field, I just don't see how I can apply my START_DT_TM and END_DT_TM parameters on this field so that START_DT_TM and END_DT_TM cannot be more than 365 days apart.  If my query does not use parameters called START_DT_TM and END_DT_TM, this "where" section will not be valid? 
    I don't think the solution has to be on the field itself but rather on the parameter START_DT_TM and END_DT_TM.  What I want is that as long as START_DT_TM and END_DT_TM are more than 365 days apart, it does not matter what field these parameters are running against. The screen would then display something saying "your date range parameters for this report must be within 365 days.  Please revise your date range on query".
    Sorry, I am PL/SQL report programmer, and not familiar with what BO can do.  So, is there anyway that can make my dream come true?  Thanks a bunch again, Amr.

Maybe you are looking for