Filter on Date Ranges

Hello experts,
I am stuck with a small problem here....need your help to sort this one out.
My requirement is
If I run a report on tues, wed, thurs & friday then select previous day's date for the report
If I run the report on monday - select fri, sat & sunday's date for the report

Sweta wrote:
(CASE
     WHEN TO_CHAR(sysdate,'D') > 2 THEN TRUNC(sysdate - 1)
     ELSE BETWEEN TRUNC(sysdate - 3) AND TRUNC(sysdate - 1)
END)Your case statement is assuming you want to return the literal 'BETWEEN TRUNC(sysdate - 3) AND TRUNC(sysdate - 1)' and it does not work that way. Although you didn't give us enough details my original response could be used to do the following:
SELECT      ...
FROM     ...
WHERE     SOME_DATE_COL >= (CASE
                    WHEN TO_CHAR(sysdate,'D') > 2 THEN TRUNC(sysdate - 1)
                    ELSE TRUNC(sysdate - 3)
               END)
AND     SOME_DATE_COL <= TRUNC(sysdate)

Similar Messages

  • Can you filter a date range in Numbers 3.1?

    It seems crazy... but I can't figure out how to filter a date range in the new Numbers (3.1).  In other words, I have a column with individual dates e.g. 31-Dec-2012, 29-Feb-2013, 19-April-2004, etc.
    I want to filter it so that ONLY the dates from 2012 show up.
    The thing is that the new filters ONLY seem to let you filter from today's date e.g. between 494 and 692 days from today.  Obviously, that isn't what I want, and it seems very wierd that something so basic would be left out.
    What am I missing?

    In the example below Column A has date values and Column B has a simple filter that displays dates if in year 2012.  Pretty simple, likely too simple.  Not sure what/how you want to display but thought I'd get something started.  The formula in Column B is: IF(YEAR(A2)=2012,A2,"").  You can hide column A if desired.

  • MDX Filter with date range

    Hi,
    my requirement is to create a calculated member to calculate Total unique customers who has sales > 0 within the date range.
    Below mdx works normally with single date
    DistinctCount(FILTER([Customer_Sales].[Outlet ID].[Outlet ID].members,
    ([Measures].[distribution],
    [Date].[CalendarWeek].CurrentMember
    )=1))
    I'm looking for something like below with date range,
    DistinctCount(FILTER([Customer_Sales].[Outlet ID].[Outlet ID].members,
    ([Measures].[distribution],
    WTD([Date].[CalendarWeek].CurrentMember
    ))=1))
    Above MDX fails with the error: String of numeric expression expected, Tuple set expression was used.
    Appreciate your immediate response.
    Thanks in advance

    Hi Chandima,
    Thanks for the response.
    I tried your code, it works but the results are not correct.  As per manual calculations, there are 28 unique customers who has positive sales on Week to date (2014-11-03), but result shows only 19.
    For the first day of week (2014-11-01), there are 9 unique customers, which is correct. But for the following days it is not giving correct result.
    Further, performance of this approach is very poor
    Thanks,

  • Getting Error in Infoview while using Date Range Filter in SAP BW Universe

    Hi,
    I have created a date range Filter in My Universe
    <FILTER KEY= "@Select(Debit Memo Date\L01 Debit Memo Date)">
    <CONDITION OPERATORCONDITION= "Between">    
    <CONSTANT CAPTION= "[ZFDAY_MTH].[LEVEL01]"/>
    <CONSTANT CAPTION= "[ZCBDATE].[LEVEL01]"/> </CONDITION></FILTER>
    It was Parsed "OK" without any errors.
    When I used this filter in my report it does not return any records, while there are some records which I had verified earlier. When I include the two fields "[ZFDAY_MTH].[LEVEL01] and "[ZCBDATE].[LEVEL01] in My Report with the filter I am getting the following error -
    A database error occured. The database error text is: A pointer intended for use is NULL. pConstantOperand is NULL in SAPSQLExpressionEvaluator::getOperandsFromCondition, exception raised at line 125 of file source/sofasqlexpressionevaluatorbase.cpp. (WIS 10901)
    If I remove the filter and run the report , it gives me the expected results.
    Please help me if anyone has faced this issue earlier.
    Thanks ,
    Pankaj Goswami

    Hi,
    How about using this code.
    I have not tested but I think if we follow this syntax pattern, it might work
    <FILTER KEY="[Debit Memo Date\L01 Debit Memo Date].[LEVEL01].[TECH_NAME]"><CONDITION OPERATORCONDITION="Between"><CONSTANT TECH_NAME="@select(ZFDAY_MTH.LEVEL01','D',,mono,free)"/><CONSTANT TECH_NAME="@select(ZCBDATE.LEVEL01','D',,mono,free)"/></CONDITION></FILTER>
    Regards,

  • Filter Data with Date range.Dates are selected in user form

    Does anybody could help me to create a user form, that user could select the date and time from either calendar or other control button (from Userform control Toolbox) and the VBA code would filter the data on Excel SpreadSheet depending on input...
    I want user to specify start time and the end time, that I would know the period of time which is on interest and filter the data depending on inputs...
    This is part of my table on Sheet1:
    ID                     Time
      Products
    ProdNoExit
    8
    04-06-2013 23:00
    15
    1
    8
    04-06-2013 23:30
    205
    1
    8
    05-06-2013 00:00
    235
    1
    8
    05-06-2013 00:30
    587
    1
    8
    05-06-2013 01:00
    874
    1
    8
    05-06-2013 01:30
    155
    1
    8
    05-06-2013 02:00
    150
    1
    8
    05-06-2013 02:30
    258
    1

    How about this?
    Right-click your tab name, and paste this code into the window that opens.
    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Address = "$A$1" Or _
    Target.Address = "$G$1" Then
    Range("Database").AdvancedFilter _
    Action:=xlFilterInPlace, _
    CriteriaRange:=Range("Criteria"), Unique:=False
    End If
    End Sub
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Using spry to filter age or date range?

    I'm trying to create a spry filter to filter between age or date ranges. I can get the code to filter an age if it's greater or below a number, but not a range between numbers. How can I modify the following code to filter between a  range of numbers? I would prefer to use drop down for age range choices so the user can choose each age from a drop down menu but I wasn't having much luck with it whereas the checkbox was somewhat working for me. If someone has a drop down method to select ages and have spry filter between the values I would be very grateful. Many thanks in advance!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Multiple Filters Sample</title>
    <link href="http://labs.adobe.com/technologies/spry/css/samples.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/xpath.js"></script>
    <script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryData.js"></script>
    <script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryDataExtensions.js"></script>
    <script type="text/javascript">
    <!--
    var dsStates = new Spry.Data.XMLDataSet("states.xml", "states/state");
    dsStates.setColumnType("name", "number");
    function ff15(ds, row, index){ var c = row.name; return c >= '6' && c <= '100' ? null : row; };
    function ffIP(ds, row, index){ var c = row.name; return c >= '11' && c <= '100' ? null : row; };
    function ffQZ(ds, row, index){ var c = row.name; return c >= '0' && c <= '10' ? null : row; };
    function ToggleFilter(enable, f)
         if (enable)
              dsStates.addFilter(f, true);
         else
              dsStates.removeFilter(f, true);
    function RemoveAllFilters()
         document.forms[0]["f15"].checked = false;
         document.forms[0]["fIP"].checked = false;
         document.forms[0]["fQZ"].checked = false;
         dsStates.removeAllFilters(true);
    -->
    </script>
    </head>
    <body>
    <div class="liveSample" style="float: left; margin-bottom: 4px;">
         <form action="">
         <label>Show '1' - '5': <input name="f15" type="checkbox" value="" onclick="ToggleFilter(this.checked, ff15);" /></label><br />
         <label>Show '6' - '10': <input name="fIP" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffIP);" /></label><br />
         <label>Show '11' - '20': <input name="fQZ" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffQZ);" /></label><br />
         <input type="button" value="Remove All Filters" onclick="RemoveAllFilters();" />
         </form>
         <div spry:region="dsStates" spry:repeatchildren="dsStates">
              <span>{name}</span>
         </div>
    </div>
    </body>
    </html>
    <states>
         <state>
              <name>1</name>
         </state>
         <state>
              <name>2</name>
         </state>
         <state>
              <name>3</name>
         </state>
         <state>
              <name>4</name>
         </state>
         <state>
              <name>5</name>
         </state>
    etc. etc.
    </states>

    The syntax for the xml file along with the rest of the source was provided in the original post. Here's the modified html file. How do I concactenate if (cat = 2) if (cat = 3) etc. into the function? Thanks in advance.
    Also as you can see from my modified html source, I want two separate drop downs: one for MINage and one for MAx age. From looking at my provided source I have a feeling that when a user clicks on one or the other drop downs it will trigger the function for that selection and cancel the other filter out, which is undesired. So I am wondering how to have two drop downs work to filter between min and max age where if a user clicks on one drop down it doesn't cancel the function of the previous filter selection.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Multiple Filters Sample</title>
    <link href="http://labs.adobe.com/technologies/spry/css/samples.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/xpath.js"></script>
    <script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryData.js"></script>
    <script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryDataExtensions.js"></script>
    <script type="text/javascript">
    <!--
    var dsStates = new Spry.Data.XMLDataSet("states.xml", "states/state");
    dsStates.setColumnType("name", "number");
    function MINage(cat){
         if (cat = 1)
           dsStates.setXPath('states/state[name > 0]');
         dsStates.loadData();
    function MAXage(cat){
         if (cat = 10)
           dsStates.setXPath('states/state[name < 10]');
         dsStates.loadData();
    -->
    </script>
    <style type="text/css">
    <!--
    .badge {
         float: left;
         margin: 4px;
         padding: 4px;
         text-align: center;
         background-color: #FFCC99;
         border-top: solid 1px #999999;
         border-left: solid 1px #999999;
         border-bottom: solid 1px #CCCCCC;
         border-right: solid 1px #CCCCCC;
    label {
         font-weight: bold;
    -->
    </style>
    </head>
    <body>
    <h3>Multiple Filters Sample</h3>
    <div class="liveSample" style="float: left; margin-bottom: 4px;">
    <form action="">
    <select name="ageCat" onchange="MINage(this.value)">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
        <option value="24">24</option>
        <option value="25">25</option>
        <option value="26">26</option>
        <option value="27">27</option>
        <option value="28">28</option>
        <option value="29">29</option>
        <option value="30">30</option>
        <option value="31">31</option>
        <option value="32">32</option>
        <option value="33">33</option>
        <option value="34">34</option>
        <option value="35">35</option>
        <option value="36">36</option>
        <option value="37">37</option>
        <option value="38">38</option>
        <option value="39">39</option>
        <option value="40">40</option>
        <option value="41">41</option>
        <option value="42">42</option>
        <option value="43">43</option>
        <option value="44">44</option>
        <option value="45">45</option>
        <option value="46">46</option>
        <option value="47">47</option>
        <option value="48">48</option>
        <option value="49">49</option>
        <option value="50">50</option>
        <option value="51">51</option>
        <option value="52">52</option>
        <option value="53">53</option>
        <option value="54">54</option>
        <option value="55">55</option>
        <option value="56">56</option>
        <option value="57">57</option>
        <option value="58">58</option>
        <option value="59">59</option>
        <option value="60">60</option>
        <option value="61">61</option>
        <option value="62">62</option>
        <option value="63">63</option>
        <option value="64">64</option>
        <option value="65">65</option>
        <option value="66">66</option>
        <option value="67">67</option>
        <option value="68">68</option>
        <option value="69">69</option>
        <option value="70">70</option>
        <option value="71">71</option>
        <option value="72">72</option>
        <option value="73">73</option>
        <option value="74">74</option>
        <option value="75">75</option>
        <option value="76">76</option>
        <option value="77">77</option>
        <option value="78">78</option>
        <option value="79">79</option>
        <option value="80">80</option>
        <option value="81">81</option>
        <option value="82">82</option>
        <option value="83">83</option>
        <option value="84">84</option>
        <option value="85">85</option>
        <option value="86">86</option>
        <option value="87">87</option>
        <option value="88">88</option>
        <option value="89">89</option>
        <option value="90">90</option>
        <option value="91">91</option>
        <option value="92">92</option>
        <option value="93">93</option>
        <option value="94">94</option>
        <option value="95">95</option>
        <option value="96">96</option>
        <option value="97">97</option>
        <option value="98">98</option>
        <option value="99">99</option>
      </select>
    <select name="ageCat" onchange="MAXage(this.value)">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
        <option value="24">24</option>
        <option value="25">25</option>
        <option value="26">26</option>
        <option value="27">27</option>
        <option value="28">28</option>
        <option value="29">29</option>
        <option value="30">30</option>
        <option value="31">31</option>
        <option value="32">32</option>
        <option value="33">33</option>
        <option value="34">34</option>
        <option value="35">35</option>
        <option value="36">36</option>
        <option value="37">37</option>
        <option value="38">38</option>
        <option value="39">39</option>
        <option value="40">40</option>
        <option value="41">41</option>
        <option value="42">42</option>
        <option value="43">43</option>
        <option value="44">44</option>
        <option value="45">45</option>
        <option value="46">46</option>
        <option value="47">47</option>
        <option value="48">48</option>
        <option value="49">49</option>
        <option value="50">50</option>
        <option value="51">51</option>
        <option value="52">52</option>
        <option value="53">53</option>
        <option value="54">54</option>
        <option value="55">55</option>
        <option value="56">56</option>
        <option value="57">57</option>
        <option value="58">58</option>
        <option value="59">59</option>
        <option value="60">60</option>
        <option value="61">61</option>
        <option value="62">62</option>
        <option value="63">63</option>
        <option value="64">64</option>
        <option value="65">65</option>
        <option value="66">66</option>
        <option value="67">67</option>
        <option value="68">68</option>
        <option value="69">69</option>
        <option value="70">70</option>
        <option value="71">71</option>
        <option value="72">72</option>
        <option value="73">73</option>
        <option value="74">74</option>
        <option value="75">75</option>
        <option value="76">76</option>
        <option value="77">77</option>
        <option value="78">78</option>
        <option value="79">79</option>
        <option value="80">80</option>
        <option value="81">81</option>
        <option value="82">82</option>
        <option value="83">83</option>
        <option value="84">84</option>
        <option value="85">85</option>
        <option value="86">86</option>
        <option value="87">87</option>
        <option value="88">88</option>
        <option value="89">89</option>
        <option value="90">90</option>
        <option value="91">91</option>
        <option value="92">92</option>
        <option value="93">93</option>
        <option value="94">94</option>
        <option value="95">95</option>
        <option value="96">96</option>
        <option value="97">97</option>
        <option value="98">98</option>
        <option value="99">99</option>
      </select>
         </form>
         <div spry:region="dsStates" spry:repeatchildren="dsStates">
              <span class="badge">{name}</span>
         </div>
    </div>
    <p><br style="clear: both;" />
    </p>
    </body>
    </html>
    Thanks!

  • Use Date Filter WebParts for Date Range In Sharepoint 2013

    Hi,
    Can someone please explain how to use the Date Filter WebParts in Sharepoint 2013 to act as a Date Range. Myrequirement is exactly like in the link
    Date Filter but this is not working on Sharepoint 2013 Designer. I am unable to edit a webpart page in Designer, add and configure these webparts.
    Request you to please help!!

    Now/Today probably isn't supported because it simply cannot work the way most people (including myself) would like for it to work.  The calculation only executes when an item is created or updated.  It does not recalculate when you view or retrieve
    the value (say through a workflow) from the field.  Because of this, "Today" would be misleading as it doesn't really mean today, but the last time the field was recalculated (created/updated).
    If the recalculation occurred each time the field was accessed or viewed, that would be of tremendous benefit.

  • How to pass date range as filter in Go URL

    Hi,
    I am trying to construct a Go Url which has two filters, date range & text. I have constructed the url as below but it keeps throwing an error. The url is not passing the max date and the application is throwing following error:
    Error: State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46048] Datetime Month value 0 from 0000-00-00 is out of range. (HY000)
    Go Url: https:companyUrl?Go&Options=rfd&Path=/shared/CompanyID/Reportlink&P0=2&P1=eq&P2=CustomObject4.%22Indexed%20Pick%201%22&P3=Leasing&P4=bet&P5="- CustomObject4 Custom Attributes".ZDate_26&P6=2+Date%20'2014-08-01'+Date%20'2014-12-31'
    Please suggest.
    Thanks,
    Kiran.

    Looks like you are converting the datatype from char to date in URL, I dont think this can be done.
    Your code is like
    &P6=2+Date%20'2014-08-01'+Date%20'2014-12-31'
    It suppose to be &P6=2+2014-08-01+2014-12-31
    I would suggest to do the formatting for this filed using Column properties and try.
    Hope this helps, pls mark if it does ;)

  • ERROR: filter condition with date range

    Oracle db; 11g r2
    ODI: 11.1.1.3
    I have an interface with filter on date column as follows
    DATE_MODIFIED >'14-JUN-2012' This is working fine.
    But when change the date value to
    DATE_MODIFIED >'01-MAY-2012' then I am getting this following error,
    942 : 42000 : java.sql.BatchUpdateException: ORA-00942: table or view does not exist
    942 : 42000 : java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
    java.sql.BatchUpdateException: ORA-00942: table or view does not exist
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:629)It seems anything more that 29 days I am getting this error.
    Even I have tried this also
    add_months(sysdate,-2), still I am getting the same error
    I think that I am missing something here but any help would be greatly appreciated.
    Thanks,

    Is it still works fine with '14-JUN-2012' and doesn't work with '01-MAY-2012'?
    Yes, It's true
    Try:
    1) Use your datastore prefixes in filters & mappings
    *could you please let me know, what does this means  datastore prefixes in filters & mappings *
    2) Avoid implicit conversions, especially with DATE type
    I am not sure on this, how to do the Avoid implicit conversions
    Thanks,

  • No Data in Reports Details in Custom date range

    Hello, iTunes U Public Site Manager Admins.
    As the iTunes U Public Site Manager admin, I've been trying to access our institution's iTunes U Reports Details for a couple of days. (I send a monthly report of usage to our course/collection contributors.) When I custom the date range, under Details, there is zero entry; "No data available in table" message is shown.
    This feature had been working well since Apple iTunes U added this enhancement on August 13, 2013. The report Details showed the exact stats for Browse, Subscribe, Download, Stream, and Enclosure for each course/collection in the custom date range.
    Now under "Details", the data is shown only when the date range is Last 30 Days. It shows no data in custom date range when the Calendar is used to select a Start Date and End Date.
    Has anyone else noticed this problem?
    Thanks.
    Q. Wang

    Erik.
    I used your suggestion and it worked very well. This is how I did it.
    Export the range of data that includes Feb. 1-Feb. 28, 2014 as .tsv file.
    Open that file in Excel.
    Add a blank column next to the Date column. Use function =Month() to just extract the month into the new column. Fill down the whole column. Then copy and paste special (value) into the same column (I have over 26,000 rows of data in the file.) Converting to Value will allow for the next step of PivotTable.
    Create a PivotTable for the 26,000 rows of data. Use Month as the Report filter, iTunes_ID as the Row Labels, Select Browse, Subscribe, etc. as the Sum Values. (The result is a summary table with about 200 rows.)
    I then do a Vlookup to my premade Master file to add Category (course, collection, resources) and Instructor Name to each of the 200 rows.
    That will do it for my monthly report.
    Thanks for your tip again. I did not know the .tsv file would have DATE for each item.
    Sincerely,
    Q. Wang

  • Date Range Issue

    Hi Experts,
    I have created a linked server to connect to mysql DB . The query is executing fine currently filter is based on the on going month.
    The query actually fetches the records from 2 tables User and time sheet to find how many hours the users have  .
    Now we check the Hours for a period of 10th of the current month and 10th of the upcoming month .
    So for now date range will be  between 2014/10/05 and 2014/10/06.  This logic i have implemented in the query .
    Based on the query a report is generated which is sent out every Wednesday  .Now suppose its 5th of June 2014 . 
    The query will fail because the date range is derived based upon
    where cast(t.created_on as Date) > Concat(year(now()),"-",month(now()),"-","10")
     AND cast(t.created_on as Date) <=Concat(year(now()),"-",month(now())+1,"-","10")
    Please provide with a date filter like the report runs anytime the data is not affected. Like if the report is run in the
    first week of a new month  date range should be previous month Date 10 and current month  Date 10 and if the report is run after 10th of the current month then the date range should be between 10th of current month and 10 of upcoming month . Kindly
    help
    Select * From
    OPENQUERY
    (Mysql,
    'Select
     Sum(t.hours),
     Concat(u.firstname," ",
     u.lastname) as Name
     From mysql.time_entries t
     Inner Join
     users u
     on u.id = t.user_id    
     where cast(t.created_on as Date) >
     Concat(year(now()),"-",month(now()),"-","10")
     AND
     cast(t.created_on as Date) <=Concat(year(now()),"-",month(now())+1,"-","10")
     Group By u.firstname,u.lastname
     Union all
     Select Sum(0) as hours,
     Concat(firstname," ",
     lastname) as Name
     from users
     where id not in(
     Select
     t.user_id
     From mysql.time_entries t
     Inner Join
     users u
     on u.id = t.user_id    
     where cast(t.created_on as Date) >
     Concat(year(now()),"-",month(now()),"-","10")
     AND
     cast(t.created_on as Date) <=Concat(year(now()),"-",month(now())+1,"-","10"))
     And firstname not in( "xyz")
      GRoup by firstName,lastname'
      go

    I recommend use CLOSED-OPEN dates rather than OPEN-CLOSED dates...
    Hopefully this helps with your logic:
    DECLARE @ReportDate TABLE
    [ReportDate] DATE,
    [mDay] AS DAY([ReportDate]),
    [Beg] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN -1 ELSE 0 END, [ReportDate]),
    [End] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN 0 ELSE 1 END, [ReportDate]),
    [ReportBeg] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN -1 ELSE 0 END, DATEADD(day, 10 - DAY([ReportDate]), [ReportDate])),
    [ReportEnd] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN 0 ELSE 1 END, DATEADD(day, 10 - DAY([ReportDate]) + 1, [ReportDate]))
    INSERT INTO @ReportDate(ReportDate)
    VALUES
    ('7-May-2014'),
    ('10-May-2014'),
    ('15-May-2014');
    SELECT
    CASE WHEN SYSDATETIME() >= [ReportBeg] AND SYSDATETIME() < [ReportEnd] THEN 1 ELSE 0 END
    FROM @ReportDate;

  • Function to list the month from a date range?

    I would like to know what the function is that would take a look at a date range, and extract the month name
    Here is how I would like it to come out:

    Hello
    The following sample tables are along your original scheme using month name to filter the data.
    2014 (excerpt)
    A1  month
    A2  =MONTHNAME(MONTH(B2))
    A3  =MONTHNAME(MONTH(B3))
    A4  =MONTHNAME(MONTH(B4))
    B1  date
    B2  2013-01-15
    B3  2013-01-20
    B4  2013-01-27
    C1  category
    C2  A
    C3  B
    C4  C
    D1  amount
    D2  100
    D3  50
    D4  20
    January
    A1  category
    A2  A
    A3  B
    A4  C
    A5  D
    A6  E
    A7  F
    A8  G
    A9  H
    B1  totals
    B2  =SUMIFS(2014::D,2014::A,C$1,2014::C,A2)
    B3  =SUMIFS(2014::D,2014::A,C$1,2014::C,A3)
    B4  =SUMIFS(2014::D,2014::A,C$1,2014::C,A4)
    B5  =SUMIFS(2014::D,2014::A,C$1,2014::C,A5)
    B6  =SUMIFS(2014::D,2014::A,C$1,2014::C,A6)
    B7  =SUMIFS(2014::D,2014::A,C$1,2014::C,A7)
    B8  =SUMIFS(2014::D,2014::A,C$1,2014::C,A8)
    B9  =SUMIFS(2014::D,2014::A,C$1,2014::C,A9)
    C1  January
    C2 
    C3 
    C4 
    C5 
    C6 
    C7 
    C8 
    C9 
    Notes.
    Formula in January::B2 can be filled down across B2:B9.
    The target month name is defined in January::C1.
    February table is the same as January table except for the value in C1.
    And the following sample tables are using date per se instead of month name to filter the data. In this scheme, you don't need month column in source table but the retrieving formulae in destination table become more complex.
    2014 (excerpt)
    A1  date
    A2  2013-01-15
    A3  2013-01-20
    A4  2013-01-27
    B1  category
    B2  A
    B3  B
    B4  C
    C1  amount
    C2  100
    C3  50
    C4  20
    January
    A1  category
    A2  A
    A3  B
    A4  C
    A5  D
    A6  E
    A7  F
    A8  G
    A9  H
    B1  totals
    B2  =SUMIFS(2014::C,2014::B,A2,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B3  =SUMIFS(2014::C,2014::B,A3,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B4  =SUMIFS(2014::C,2014::B,A4,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B5  =SUMIFS(2014::C,2014::B,A5,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B6  =SUMIFS(2014::C,2014::B,A6,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B7  =SUMIFS(2014::C,2014::B,A7,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B8  =SUMIFS(2014::C,2014::B,A8,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    B9  =SUMIFS(2014::C,2014::B,A9,2014::A,">="&EOMONTH(C$1,-1)+1,2014::A,"<="&EOMONTH(C$1,0))
    C1  2013-01-01
    C2 
    C3 
    C4 
    C5 
    C6 
    C7 
    C8 
    C9 
    Notes.
    Formula in January::B2 can be filled down across January::B2:B9.
    The target month is defined in January::C1, which can be any date in target month, e.g., 2013-01-01, 2013-01-20, etc. The formulae in B will retrieve data with date in range: 2013-01-01 <= [date] <= 2013-01-31.
    February table is the same as January table except for the value in C1.
    Tables are built in Numbers v2.
    Hope this may help,
    H
    EDIT: Replaced the last table with the correct one. (Formulae in B are correct)

  • How to take unreconcilled transactions report for a date range ?

    hi all,
    How to take unreconcilled transactions report for a
    data range ?
    we have taken unreconcilled transactons from
    external reconcillation using filter option mentioning
    range of dates,But when we take print out using PLD,
    it showing unreconcilled transactions for all dates.
    But our client requires it as a standard report from SAP ?
    Our client is using SAP B1 2005B PL39.
    Jeyakanthan

    Hi
    Financials -> Financial Reports -> Accounting -> General Ledger.
    In the 'Display' dropdown select, 'Unreconciled' .
    Hope this should help you.

  • Possible to do limited date range changes in Calendar?

    If I set up a filter, say, for days since my last sync AND I'm doing a two-way sync, will only those changes sincy my last sync be synced or will I lose everything not in that date range? Since I make changes to the calendar in Outlook and on the device this is especially important to me. This could save me a lot of time, but I don't want to lose any other calendar data
    Also, I assume that I set the filter to use 'start date' and uncheck the box that says ' Delete from device any data that does not match the filter'. I am using DM 4.6 and OS 4.3
    IrwinII
    Please remember to "Accept as Solution" the post which solved your thread. If I or someone else have helped you, please tell us you "Like" what we had to say at the bottom right of the post.

    Hi Mark,
    Yes, you can pass a date range value to the SUbreport!
    Here's how its done:
    1) Create a formula in the Main report; call it Start_date:
    Minimum({?Date_parameter})
    2) Create a second formula in the Main report and call it End_date:
    Maximum({?Date_parameter})
    3) Insert the sub-report and then Right-click the sub-report > Select Change Subreport links > Move the Start_date and End_date formulas to 'Fields to Link to' area and make sure you uncheck the 'Select data in subreport based on field' option.
    4) Edit the sub-report (Right-click > Edit) and insert a Record Selection formula to include the parameters from the Main Report.
    Go to Report > Selection Formulas > Record:
    {date_field} >= {?Pm-@Start_date} and {date_field} <= {?Pm-@End_date}
    Hope this helps!
    -Abhilash

  • How to get XLR to show BPs with no transaction data for a given date range

    Hi -
    I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
    The report has the row expansion:
    FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
    and column expansions:
    FIG(SO_TaxDate = @StartDate:@EndDate)
    and
    FIG(SO_TaxDate = @StartDate2:@EndDate2)
    where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
    The column formulas are, from left to right:
    =ixDimGet("BPA", "CardName")
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for first date range
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for second date range
    The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
    Any help is greatly appreciated!
    Thanks,
    Lang Riley

    Really appreciate your feedback!  Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
    Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query. 
    Using **, i.e., * or #NULL, makes no change in the resulting data in this case.  I had thought that ** would be the solution, but it didn't change the outcome.  I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear. 
    I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set.  It seems that perhaps the IXL query needs to be restructured?  Please keep the suggestions coming including how this query might be restructured if necessary.

Maybe you are looking for

  • Macbook won't boot past white screen

    My girlfirend's 2009 macbook aluminum unibody ((Leopard 10.5.x) is having a problem booting up. Initially I ran Onyx on it and it said it needed a disk repair. I ran a quick hardware test and it came back ok. I ran Disk Utility off of the cd and it s

  • Script to determine how a DVD player is configured and enable the Stream

    Hi Does anyone know how to use scripts to detect the configuration of a DVD Player (I am interested in aspect ratio settings) and then using another script, choose the appropriate subtitle stream to use for that player? Cheers Barry

  • Hyper-V Cluster Name offline

    We have a 2012 Hyper-V cluster that isn't online and we can't migrate VMs to the other Hyper-V host.  We see event errors in the Failover Cluster Manager: The description for Event ID 1069 from source Microsoft-Windows-FailoverClustering cannot be fo

  • Shortcut to close window in Safari but the current?

    I've been searching all over for this. I'm sure it s obvious ,but the words that I search are so common ,I get way to much info. Anyway I want to know how I can close all safari window but the currently active. Lets say there is 5 windows or tabs ope

  • Flatten a hierarchy

    I'm trying to flatten a hierarchy. I have a table with a parent/child relationship in the following order Parent_ID Child_ID 1234 1234 1234 1235 1235 1236....etc I would like to transform the hierarchy to 1234 , 1235, 1236 If I use a sys_connect_by I