Date range validity evaluation in BRM table

Lectori salutem, Gurus salutem,
I'm using 7.3 sp03. I would like to achieve the following with BRM (bit simplified):
a parameter, ABC, is passed to a ruleSetService, and needs to be evaluated.
The table is as follows:
ABC startDate endDate Value
1 01-01-2011 31-12-2011 A
1 01-01-2012 31-12-2012 B
2 01-01-2011 31-12-2011 X
4 01-01-2012 31-12-2012 Y
When ABC-value '1' is passed to the ruleSetService in the table the first row needs to be selected. CurrentDate (24-11-2011) is in between 01-01-2011 and 31-12-2011, making this the valid row. The value that should be returned is A.
Beginning of next year it should change to B.
How should I set this up in BRM?
Thanks in advance!
Martijn.

Hi Martijn,
Appreciate that you've simplifiied the scenario... but do you have any idea how many of these entries you are likely to have in total as that may change the answer.
You have a couple of choices that might work here...
1. You could a decision table... to hold your values (i.e. ABC and date range as conditions, value as action) and use the rule that evaluates the decision table to pick up the current date for the comparison. e.g.  date conditions would be "greater than than 01-01-2011", "less than 31-12-2011", etc.
2. Alternatively, if the plan is to have a simple end of year change over,  you could use Effectivities (in the Project Resources of the rules project) to determine which values  are selected and use a decision table or even just a rule script to determine the value.
But the thing is... HOW you organise your rule is going to depend a lot on:
a) How many entries in total do you expect
b) Is there a nice neat cutover of all ABC values at the same time or do effective date ranges vary a lot between different ABC values
c) Who's responsible for maintaining these and if multiiple people are responsible do you need to organise your rule to cater for that? E.g. Are different people responsible for different ABC entries
Does that help at all?
Regards,
Jocelyn

Similar Messages

  • Date range validation

    I have a requirement where i have to check date range in select option and if its more than 45days the I have to give an Informatory message and exit the programme , How can I do that ??
    Urgent Plzz..

    Hi,
      try this code...
    TABLES: zpr_prog_item.
    DATA: cnt TYPE i.
    SELECT-OPTIONS date FOR zpr_prog_item-date_shoot.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis                   = date-high
        i_datum_von                   = date-low
    IMPORTING
       e_tage                        = cnt
    EXCEPTIONS
       DAYS_METHOD_NOT_DEFINED       = 1
       OTHERS                        = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      IF cnt < 45.
        LEAVE TO LIST-PROCESSING.
        WRITE:/ date-low,
              / date-high,
              / cnt.
      ELSE.
        MESSAGE i000(zsam).
        LEAVE SCREEN.
      ENDIF.
    regards,
    Bhuvana.

  • Date Range Validity periods for Addresses

    Hello,
    In the BP transaction when entering address details I cannot see a place to enter a validity period for the address even though in BUT020 there are database fields on this table to store a To and From date for and address.
    Does anyone know how to make these date field available for entry?
    Many thanks in advance.
    David

    Thanks.
    When I go to this in SPRO I can see the field 'BP Address: Time-Dependent Usages' for the role I need to change.
    However when I make this field 'optional' is still does not appear.
    If I select optional on some other fields e.g. 'Address-Indep.Communication Data: Mobile Telephone' this field appears.
    Is there anything else I need to do to make this field appear?
    Regards
    David

  • Date Range valid check on BSP Application

    Hallo,
    i want to  display brochures with its validity date in BSP application.Can anybody help me. i was rejected because i posted my code here ,i cant post it again.
    regards

    hi,
    In which block  you want to keep the validation . In Layout of in Onevent processing block. ??
    <script for="sd" event=onchange type="text/javascript">
    var data = this.value;
    var date = data.split(".");
    if (data != ' ')
    var day = date[0];
    var month = date[1];
    var year = date[2];
    if ((day<1 || day >31) || (month<1 || month>12) ||(year.length != 4))
    alert("Please enter a valid  Date ( mm.dd.yyyy )");
    endif.
    hw come ur post  got reject ?
    Please specify whr u want to embed validation .

  • Dynamic Date range validation

    Hi all,
    I have 2 date fields in a page: Start Date, End Date. The Start Date should not be later than End Date.
    I don't know how to write a validation to control TWO fields. I cannot use the built-in ADF declarative validation at Entity Level, since I want to set the autoSubmit=true to do validation at realtime.
    What I have done is I created validator function for both fields, the function works fine except this:
    1. user input 1-1-2000 to Start Date, user input 1-1-1999 to End Date. the invalid dialog appears for end date
    2. user input 1-1-1990 to Start Date, but the End Date is still Invalid.
    Is there anyway to fix this problem?
    I am using Jdeveloper 11.1.1.2 with ADF BC.
    Regards,
    Samson Fu

    I found the solution for this, post here for anybody have the same problem.
    http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/interfieldValidation.jspx
    Regards,
    Samson Fu

  • Split dates into date range windows

    Hi,
    I have a peculiar requirement to create windows for different dates.
    For example I have two date ranges (two rows in the table column
    Start Date End Date
    01-Jan 28-Feb
    15-Jan 14-Feb (this starts between the previous date range i.e. 01-Jan to 28-Feb)
    I have to split dates in a way so that it creates different windows with start and end date i.e.
    Start Date End Date
    01-Jan 15-Jan (15Jan because it comes before 28 Feb)
    16-Jan 14-Feb ( 14Feb as it comes before 28 Feb)
    15-Feb 28-Feb
    Is there any sql function which can be used to achieve this? or any help you can provide? Thanks.
    -Salman

    Welcome to the forum!
    Unfortunately you posted to the wrong forum. This forum is for sql developer only.
    Repost you question in the SQL and PL/SQL forum and you will get help there.
    Please mark this question ANSWERED to people will follow up in the other forum.

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • Creation of internal table dynamically based on the Date Range entered

    Hi SAPgurus,
    I have been facing one issue i.e creation of internal table dynamically based on the date range entered in the selection screen. For example the date range I am giving as 06/2006 to 08/2006, it should display the Fieldcatelog dynamically, this part i have completed but the only issue I am facing is to populate the sales data into that fields.
    Right now my program is displaying the ALV like this.
    Ex:
    <b>CSR    District   06/2006  07/2006  08/2006  totals</b>      
    Shiva      New York                             10.00
    Shiva      new york                             30.00
    Shiva      new york                             40.00
    but it should display like this
    <b>CSR    District 06/2006 07/2006 08/2006 totals</b>
    Shiva  New York  10.00   30.00 40.00
    80.00                 
    Please help me in this scenario, how to acheive like this..
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
                 I also got the same requirement . i saw rich and your code whatever you have uploaded.i have created dynamic internal table but i am facing the issue to populating the data to my dynamic internal table.
    Sivaram, can you please explain your code after this.
    *<dyn_table>
    *tab_item.
      LOOP AT tab_item.
        ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_table>.
        ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_table>.
    *    <dyn_wa> = tab_item-bztxt.
    *    <dyn_wa> = tab_item-total.
    *    APPEND <dyn_wa> TO <dyn_table>.
    **    <dyn_wa> = tab_item-total.
    **    ASSIGN tab_item-bezei  TO <dyn_wa>.
    *  APPEND <dyn_table>.
      ENDLOOP.
    how you are puting the loop at tab_item. but tab_item is already commented.
    can you send me the code after that.
    i am sending some part of my code.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = gt_fCAT1
       IMPORTING
         ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
       create data new_line like line of <dyn_table>.
       assign new_line->* to <dyn_wa>.
    select vbeln
            fkart
            vkorg
            vtweg
            fkdat
            spart
            fksto
            from vbrk
            client specified
            into table gt_vbrk
            where mandt = sy-mandt
            and fkart in ('ZF5','ZFR')
            and vkorg = '1100'
            and vtweg = '20'
            and fkdat in s_fkdat
            and spart = '06'
            and fksto = ' '.
       if gt_vbrk[] is not initial.
      select  vbeln
              fkimg
              prsdt
              netwr
              matnr
              arktx
              werks
              mwsbp
              from vbrp
              client specified
              into table gt_vbrp
              for all entries in gt_vbrk
              where vbeln = gt_vbrk-vbeln
              and werks in s_werks
              and matnr in s_matnr.
      endif.
    select mnr ltx spras from t247
    into table it_t247
    where spras = 'E'.
    data: lv_month1 type vbrp-prsdt,
           name1(3) type c,
           s_month type string,
            s_month1 type string,
             s_month2 type string.
    *      lv_netwr1 type vbrp-netwr,
    *          lv_mwsbp1 type vbrp-mwsbp.
          loop at gt_vbrp into gs_vbrp.
            gs_final2-matnr = gs_vbrp-matnr.
            gs_final2-arktx = gs_vbrp-arktx.
            gs_final2-fkimg = gs_vbrp-fkimg.
           lv_month1 = gs_vbrp-prsdt.
            read table it_t247 into wa_t247 with key mnr = lv_month1+4(2).
            if sy-subrc eq 0.
            name1 =  wa_t247-ltx.
            endif.
             concatenate  name1
                       lv_month1(4) into s_month SEPARATED BY '_' .
             CONCATENATE S_MONTH 'QTY' INTO S_MONTH1 SEPARATED BY ''.
              CONCATENATE S_MONTH 'VALUE' INTO S_MONTH2 SEPARATED BY ''.
             gs_final2-month = s_month.
              lv_netwr1 = gs_vbrp-netwr.
            lv_mwsbp1 = gs_vbrp-mwsbp.
            gs_final2-MONTH_QTY = S_MONTH1.
            GS_FINAL2-MONTH_VAL = S_MONTH2.
            gs_final2-value = lv_netwr1 + lv_mwsbp1.
           append gs_final2 to gt_final2.
           clear: gs_final2. "lv_name2.
           endloop.
           if gt_final2[] is not initial.
             sort gt_final2 by matnr month ascending .
             loop at gt_final2 into gs_final2.
            gs_final2_01 = gs_final2.
         collect gs_final2_01 into gt_final2_01.
        endloop.
           endif.
       ENDIF..
    Regards
    Ankur

  • Neen help with date range searches for Table Sources

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 24-MAR-07, 22-SEP-), 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • Need help with date range searches for Table Sources in SES

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 10-MAR-07, 22-SEP-07, 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks very much, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • To select from database table based on date range

    hi
    i have a selection screen in which date range is being given
    say eg 23/06/07  to 23/12/08
    based on this date i want to select data from a ztable
    eg i want to select a field amount from table
    and three is a field date range on the table
    for this particular field i want to select all records for amount field  and factual field falling wiithing this date range and sum it
    eg
    based on date range as in selcetion screen
    select amount( field1)  factual ( field2) from ztable into it_ztable where date = ?....
    please give me code for it  and how to sum all values as i will get from the ztable into internal table the two values as fetched from the ztable
    please suggest asap
    regards
    arora

    hi
    i am using
    sELECT field1 field2 FROM Ztable  INto it_matu
                       where DATE GE sl_dat-low    
                        AND  DATE LE sl_dat-high.   
    i am getting data in internal table but
    say i have twelve records now i want to sum it the both the columns into and use that sum final amount to display
    let me know how to use sume in the intrranal tabl do i need to use control statement
    how to use the sum for two columns and take into a serperate variable to display
    regards
    aRora

  • Compare date ranges in two tables

    Hello,
    I'm trying to figure out a way of comparing the range of dates between two date columns from a single row in one table, to the range of dates from multiple rows in a related table.
    t1 (t1_id, absent_start_date, absent_stop_date)
    t2 (t2_id, t1_id, cover_start_date, cover_end_date)
    t2 has multiple rows for each row in t1
    I need to select rows from t1, in which the set of days for rows in t2 do not match the set of days between absent_start_date and absent_stop_date.
    For example, assume this row in t1:
    1, '10/08/2007', '15/08/2007'
    The set of days would be 10/08/07,11/08/07,12/08/07,13/08/07,14/08/07,15/08/07
    and these rows in t2
    1, 1, '10/08/2007', '11/08/2007'
    2, 1, '12/08/2007', '12/08/2007'
    3, 1, '14/08/2007', '15/08/2007'
    The set of days would be 10/08/07,11/08/07,12/08/07,14/08/07,15/08/07
    In this case, the related rows in t2 do not cover the same date range as the master row in t1, and so I need to select this row from t1 somehow.
    Any ideas anyone?
    Thanks.

    I am not sure about the exact output you want, but the next query will give you all gaps in the periods, so the presence of a row in this output may be enough?
    SQL> create table t1
      2  as
      3  select 1 t1_id, date '2007-08-10' absent_start_date, date '2007-08-15' absent_stop_date from dual union all
      4  select 2, date '2007-09-01', date '2007-09-10' from dual
      5  /
    Tabel is aangemaakt.
    SQL> create table t2
      2  as
      3  select 1 t2_id, 1 t1_id, date '2007-08-10' cover_start_date, date '2007-08-11' cover_stop_date from dual union all
      4  select 2, 1, date '2007-08-12', date '2007-08-12' from dual union all
      5  select 3, 1, date '2007-08-14', date '2007-08-15' from dual union all
      6  select 4, 2, date '2007-09-03', date '2007-09-05' from dual union all
      7  select 5, 2, date '2007-09-07', date '2007-09-08' from dual
      8  /
    Tabel is aangemaakt.
    SQL> select  *
      2    from ( select t2.t1_id
      3                , lag(t2.end_date+1,1,t1.absent_start_date) over (partition by t2.t1_id order by t2.start_date) gap_start_date
      4                , t2.start_date-1 gap_end_date
      5             from t1
      6                , ( select t1_id
      7                         , cover_start_date start_date
      8                         , cover_stop_date end_date
      9                      from t2
    10                     union all
    11                    select t1_id
    12                         , absent_stop_date+1
    13                         , absent_stop_date+1
    14                      from t1
    15                  ) t2
    16            where t1.t1_id = t2.t1_id
    17         )
    18   where gap_start_date <= gap_end_date
    19   order by t1_id
    20       , gap_start_date
    21  /
                                     T1_ID GAP_START_DATE      GAP_END_DATE
                                         1 13-08-2007 00:00:00 13-08-2007 00:00:00
                                         2 01-09-2007 00:00:00 02-09-2007 00:00:00
                                         2 06-09-2007 00:00:00 06-09-2007 00:00:00
                                         2 09-09-2007 00:00:00 10-09-2007 00:00:00
    4 rijen zijn geselecteerd.Regards,
    Rob.

  • Split date range without Calendar table

    Hi guys!
    Is there any way to split date ranges (to days / hours / minutes) in one table without using Calendar table (without joining 2 tables)?
    Reason I'm asking this is because we have a huge Fact table (500+ million records) and joining small Calendar table and this huge Fact table takes considerable amount of time.
    So far we tried:
    Join 2 tables (Fact and Calendar)
    Cross Applying Calendar and table-valued function (that returns necessary measures from Fact table)
    and both approaches took few minutes for 1 day to complete.
    Most successful test we had so far was using CLR and executing table-valued functions in parallel for different 15 minute periods. This way we were able to get the results in 3-4 seconds.
    Anyway, is there any effective pure T-SQL way to accomplish this?
    Thanks in advance,
    Miljan

    Try using a temporary table rather than table variable.. You can have a CI on the date column.
    or
    declare @PeriodStart datetime2(0) = '2013-01-05 00:00:00'
    declare @PeriodEnd datetime2(0) = '2013-01-05 02:00:00'
    select T.PeriodStart, T.PeriodEnd, count(Column1)as count1, sum(Column2)as sum1
    from Fact F with(nolock)WHERE F.[Start]>= '19000101' AND <=@PeriodStartand F.[End] >= @PeriodEnd and F.[End] <='20200101'
    group by T.PeriodStart, T.PeriodEnd
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to pull records only for particular date range in Flex frm SAP wd table

    Hi,
    Can anyone help me with databing for datefield.
    I am using two datefields in Flex for Start Date and End Date. When I click the Execute button, it should pull only the records for that date range from SAP wd table and display in my Flex datagrid.
    Thanks,
    Sri
    Edited by: rmsridevi on May 17, 2011 4:38 PM

    Hi,
    Your query has mistakes as well. I corrected them.
    Check this two different ways were in first you can define the period (month) you want and in second you have the option to select from the drop drown list :
    SELECT T0.DocNum, T0.DocDate, T0.CardName,T0.DocTotal,T1.whsCode
    FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE t0.docdate >= '2011.01.01' and t0.docdate <='2011.01.31'
    OR
    SELECT T0.DocNum,T0.DocDate,T0.CardName,T0.DocTotal,T1.whsCode
    FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE t0.docdate >= [%1] and t0.docdate <= [%2]
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Filtering by date or date range by using FilterCriteria on a Table

    I am able to use the built-in feature of Table to filter the rows based on a text field (i.e display only those rows that has a certain value of a text field). Here is an example code:
                CompareFilterCriteria criteria1 = new CompareFilterCriteria(new FieldKey("user_lname"), "Test ");
                FilterCriteria fCreteria[] = new FilterCriteria[1];
                fCreteria[0] = criteria1;
                getTableRowGroup1().getTableDataFilter().setFilterCriteria(fCreteria);This works. Now I need to figure out how to filter based on a date field. I want to be able to filter if date value is before/after a date or between a date range. I was wondering if I could use RegexFilterCriteria for this.
    Any pointers, code, examples are highly appreciated. There is very little documentation on filtering in JSC.
    Thanks

    Thats my fall back in case if I can't use the built-in filtering. Table component has all the filtering built into it. I believe, this is faster too, as its cached vs. executing SQL every time user searches for some records.
    Creator Team: I have noticed a lot of people using SQL when they could have used Filters -- because no one know how to use it. No documentation on it, except API doc, which is lacking in explanation.
    When you have put all this hard work developing it, why not put a little more in documenting it with examples/codes/tutorials?
    Message was edited by:
    Sabir

Maybe you are looking for

  • Any option to get the list of Invoice with respect to Sales Area

    Dear All, Is there any option to check the list of Invoices with respect to the Sales area. Because, in VF05, we are getting the list either for a Payer or a Material. I want to see the list of Invoices for a Sales area. I mean, it should be similar

  • How to find open Po's.?

    Hi frds.. How to find the open POs(POs without GR) and tell me in which table and field it stored ? thanks Pari Vendhan.R

  • PDF will not display in an IE browser window

    I have the following setup: Windows Vista Business w/ SP2 Internet Explorer 8 (8.0.6001.18813) Adobe Reader 9 (9.1.3) When accessing a PDF document using IE8, the PDF will not display in an IE browser window.  Instead, the PDF opens in a new Adobe Re

  • Finicky Wireless Connection

    I've had my MacBook Pro for about 4 months now, and have noticed numerous problems with the wireless connection. On a regular day, I connect to at least 2 or 3 different ones, and my computer always seems to have more problems than the average Window

  • Recovering files time machine deleted

    Is there a way to recover files from a back up that time machine deleted? I was in the middle of recovering files then the computer just hanged so I had to force shutdown. When I booted up again, I can't find any of my documents in ALL of the time ma