Filter on date ranges

Hello experts,

I'm stuck with a little problem here... need your help to resolve it.

My requirement is

If I run a report on the Tuesday, Wednesday, Thursday and Friday, and then select the day before for the report date
If I run the Monday report - select fri, Saturday & Sunday for the report date

Sweta says:
(CASE
WHEN TO_CHAR(sysdate,'D') > 2 THEN TRUNC (sysdate - 1).
Of OTHER BETWEEN TRUNC (sysdate - 3) AND TRUNC (sysdate - 1).
END)

Your case statement is assuming that you want to return the literal "BETWEEN TRUNC (sysdate - 3) AND TRUNC (sysdate - 1) ' and it does not work like that. Although you do not give us enough details my initial response can 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)

Tags: Database

Similar Questions

  • Filter by date range table

    I use JDev 11.1.1.6

    I'm following Frank worm detailed information on how to filter the ADF tables by date range. The link is below.


    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/59-table-filter-by-data-range-176653.PDF


    I have 2 problems that I deal. They are:

    (1.) the datapicker for both filters are not make the date picker when I click on it. As I said I use 11.1.1.6 which I think should work. Note to Frank says he did not before 11.1.1.6. I can manually enter the date ranges and the filter works.
    2.) when I filter by my date or any other filter on the page, the filter returns the data that I expect to be back. For some reason the date filter is more restores. It's as if the entire filter facet disappears. I suspect it is because I do something wrong in the bean support. I posted this code below.

    Let me know if you have thoughts about what I might get hurt.


    {} public void onQuery (QueryEvent pQueryEvent)
    ArrayList < object > lAuditCodeArray = null;
    FilterableQueryDescriptor = lFilterableQueryDescriptor
    (FilterableQueryDescriptor) pQueryEvent.getDescriptor ();
    as submitted by the user such current filter criteria
    Map lCriteriaMap = lFilterableQueryDescriptor.getFilterCriteria ();

    The method links to set on the access ViewCriteria bind variables.
    OperationBinding = lRangeStartOperationBinding
    getBindings () .getOperationBinding ("setAuditDateRangeStart");
    OperationBinding = lRangeEndOperationBinding
    getBindings () .getOperationBinding ("setAuditDateRangeEnd");
    Object lAuditDateStartRange = lCriteriaMap.get ("AuditDateStartRange");
    Object lAuditDateEndRange = lCriteriaMap.get ("AuditDateEndRange");
    lRangeStartOperationBinding.getParamsMap () .put ("value",
    lAuditDateStartRange);
    lRangeEndOperationBinding.getParamsMap () .put ("value",
    lAuditDateEndRange);
    lCriteriaMap.remove ("AuditDateStartRange");
    lCriteriaMap.remove ("AuditDateEndRange");
    lRangeStartOperationBinding.execute ();
    lRangeEndOperationBinding.execute ();


    lFilterableQueryDescriptor.setFilterCriteria (lCriteriaMap);

    run the default QueryListener code added by JDeveloper
    ADFUtil.invokeMethodExpression ("#{bindings.") Audit2Query.processQuery} «»
    Object.Class, QueryEvent.class,
    pQueryEvent);


    filter of restoration carried out by the user selection
    llCriteriaMap.put ("AuditDateStartRange", lAuditDateStartRange);
    lCriteriaMap.put ("AuditDateEndRange", lAuditDateEndRange);
    lFilterableQueryDescriptor.setFilterCriteria (lCriteriaMap);
    }



    Here's the column I'm filtering where it's useful.


    < af:column sortProperty = "CrtdDttm" sortable = "true".
    headerText = "Date".
    ID = "crtDate" align = "center" width = "260".
    filterable = "true" >
    < f: facet = name 'filter' >
    < af:panelGroupLayout id = "pgl1" layout = "horizontal" >
    < af:panelLabelAndMessage label = "" to: ""
    ID = "plam1" >
    < af:inputDate id = "id1".
    value = "#{vs.filterCriteria.AuditDateStartRange} '"
    clientComponent = "false" >
    < af:convertDateTime pattern = "#{bindings." CsgAudit2.hints.CrtdDttm.format}"/ >
    < f: validator binding = "#{bindings." CrtdDttm.validator} "/ >"
    < / af:inputDate >
    < / af:panelLabelAndMessage >
    < af:spacer width = "5" height = "5".
    ID = "s5" / >
    < af:panelLabelAndMessage label = "" to: ""
    ID = "plam2" >
    < af:inputDate id = "id2".
    required value = "#{vs.filterCriteria.AuditDateEndRange}" = 'false' "
    clientComponent = "false" >
    < f: validator binding = "#{bindings." CrtdDttm.validator} "/ >"
    < af:convertDateTime pattern = "#{bindings." CsgAudit2.hints.CrtdDttm.format}"/ >
    < / af:inputDate >
    < / af:panelLabelAndMessage >
    < / af:panelGroupLayout >
    < / f: facet >
    < af:inputDate value = "#{row.bindings.CrtdDttm.inputValue} '"
    required = "#{bindings." CsgAudit2.hints.CrtdDttm.mandatory}.
    shortDesc = "#{bindings." CsgAudit2.hints.CrtdDttm.tooltip}.
    ID = "id3" readOnly = "true" >
    < f: validator binding="#{row.bindings.CrtdDttm.validator}"/ >
    < af:convertDateTime pattern = "#{bindings." CsgAudit2.hints.CrtdDttm.format}"/ >
    < / af:inputDate >
    < / af:column >

    Can you try to remove the validator and convert date time to the side of the filter and check.
    I had a similar problem with my custom filter and the filter facet did not. I discovered that it was because I had created a property my filter component (selectonechoice) bean binding.
    I used version Jdev 11.1.1.4.

    Thank you
    Rakesh

  • Article 059 (filter how-to ADF related tables by date range) in JDeveloper 12 c (12.1.3)

    Hello.

    I try to implement a solution to article 059 (filter how-to ADF related tables by date range) in JDeveloper (12.1.3) 12 c but hothing happen when I start this example.

    Could someone advise me what to do to make this example work properly on JDeveloper 12 c?

    I made the example work again. The problem is that you can't somehow store new attribute values in the card more. If you store the values for the filter to a different place, it works again.

    Please read the complete solution in my blog https://tompeez.wordpress.com/2015/04/11/how-to-filter-adf-bound-tables-by-date-range-jdeveloper-12-1-x/

    You can download the workspace of GitHub. The link is provided at the end of the blog.

    Timo

  • How to pass the date range as in URL filter go

    Hello

    I am trying to build a Url go that has two filters, date range & text. I built the url below, but he continues to throw an error. The url is not from the date max and the app starts following error:

    Error: Status: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 46048] Month DateTime value 0 0000-00-00 is off limits. (HY000)

    Go to Url: https:companyUrl? GB & Options = rfd & Path = / shared/CompanyID/link & P0 = 2 & P1 = eq & P2=CustomObject4.%22Indexed%20Pick%201%22 & P3 = Leasing & bet = P4 & P5 = ""-CustomObject4 Custom Attributes '. " ZDate_26 & P6 = 2 + Date % 20'2014-08-01'+ day % 20'2014-12-31'


    Please suggest.

    Thank you
    Kiran.

    It seems that you convert the data type of char to date in the URL, I don't think that this is possible.
    Your code is like
    & P6 = 2 + Date % 20'2014-08-01'+ day % 20'2014-12-31'

    It suppose to be & P6 = 2 + 2014-08-01 + 2014-12-31

    I suggest doing the formatting for this filed using column properties and try.

    Hope this help, pls mark if yes ;)

  • Date range prompt--Null default value

    Hello

    It is a follow-up on post Date invites default NULL

    I have a similar case but using database directly request the report and have implemented a variable presentation with two date ranges. I want to leave the default value of the date white values in the dash prompt, but have the ability to enter values in the other guests and ignore the date of the application

    I have 4 variables of presentation being placed in the SQL query, two of which are the date ranges (between)

    I use OBIEE 10.3.1.4, is there a workaround to run the report using the other prompt values and ignoring the date values null?

    Hello

    Keep your 1900 filter in report itself and no default value chosen at the prompt. If this value is not visible in the dashboard and it will fly too when the user selects a value from the command prompt.

    Thank you

    AJ

  • Filtering on two date range filters

    Hi people,

    I need your valuable contributions to the solution.

    It must filter the analysis by using two date range prompt as shown below.

    Of Date1 - Date1

    Of Date2 - Date2

    Note: We use only a Date column for the whole Date and so far

    Requirement:

    ---------------------

    If Date1 and Date 1 is selected, then the first column of the analysis line should display as

    COLUMN1

    ------------------------------------------

    Of Date1 - Date1

    If both Date1 and Date 2 and Date1 AND Date2 is selected, then the first column of the analysis line should display as

    COLUMN1

    -------------------------------------------

    Of Date1 - Date1

    Of Date2 - Date2

    I hope I'm clear in the explanation of my requirement.

    Thanks to you all.

    DJ

    Check this box

    Oracle Business Intelligence, OBIEE 101: OBIEE between Dates invites

  • On the date ranges in search of oracle forms

    I use service number, name, type person and date as search criteria in the custom form ranges.
    When I enter the employee number, press the search button, I get the exact info in the block of result.
    Result block contains
    name of the employee, personid, emp numbed, org, start_date.
    Similarly when I enter the employee number, dept, I get the correct values.
    My question is, when I enter the date range. IAM unable to filter the data.
    When I enter START_DATE between nvl(:BLOCKNAME.) Start_date, 1 January 1901 ') and nvl(:BLOCKNAME.) End_date, 31-DEC-4712') where block clause in the result. I had data for the range of dates also.

    If I give condition in where clause results take so long when I search with the name of the employee, number, dept, person type.

    If I have a query with the date, the persormance is good.

    Think you know everything, how it prevents START_DATE between nvl(:BLOCKNAME.) Start_date, 1 January 1901 ') and nvl(:BLOCKNAME.) End_date, 31-DEC-4712') when look us with the employee's name, number, dept, person type.

    So leave the WHERE clause of your empty block and put something like the following in your search button:

    IF    :BLOCK.START_DATE IS NOT NULL
       OR :BLOCK.END_DATE IS NOT NULL THEN
      SET_BLOCK_PROPERTY('YOURBLOCK', ONETIME_WHERE, 'START_DATE between nvl(:BLOCKNAME.START_DATE,TO_DATE(''01-JAN-1901'', ''DD-MON-YYYY'')) and nvl(:BLOCKNAME.END_DATE,TO_DATE(''31-DEC-4712'', ''DD-MON-YYYY''))');
    END IF;
    
  • To add totals in a certain date range

    I have 3 sheets. Income, expenses and then an annual journal (has twelve columns, one for each month). Is there a way to get the numbers to add totals to a column of the spreadsheet of spending within the date range 01/01/16 and 31/01/16 and put the total in a cell in January on my sheet of each year. I can't understand a formula so that it can find the date range. I get a synyax error message.

    Assumptions:

    Your TABLES (not the leaves) are named income, spending and summary. Here is any other tables in the document with these names.

    Dates of expenditure are in column A of the table expenses. Other than the header line, all the entries in this column are values Date and time that have been entered as dates only.

    The amount for each item of expenditure is in column C of the expense table.

    Line 1 of the analytical table is defined as a header line.

    January is in column A of the summary table.

    Summary::A1 cell contains the date January 1, 2016, but can be formatted to display only the name of the month or the month and year. (but see the note below) *.

    Enter the formula in the cell that will contain total expenditures recorded with dates in January 2016 below:

    = SUMIFS ("Expenses: Expenses, $C: $A," > = "& A1, Expenses: $A," < = "& EOMONTH(A1,0))

    Example: All the amounts of expenditure were reduced to 1.00 simple confirmation of funds.

    * NOTE: The formula has previously worked with the format of the cells in the row 1 Summary defined to show only the month and the year (two digits) of the effective date values (the first day of the month indicated), but the table I built tonight January 1, 2015 to the format to display 16 Jan, one was interpreted as January 16 (2016) , and SUMIFS formula did not include not January 1 to January 14 numbers in January total.

    A custom, displaying the month (short or long) and the year (four digits) or a custom format shows only the name of the month (short or long) gave good results.

    Note that any format under control of the display, the effective date is the first of the month displayed.

    Table built and tested in Numbers ' 09 (v 2.3)

    Kind regards

    Barry

  • Conditional formatting depends on the date ranges

    Basically, I want to be able to enter a date in column A and a sum of money in the B column, depending on where the date in column A grave in a date range, I want the money in column B to copy to a corresponding column. Is this possible? The only questions I found on here deal in a conditional formatting with dates have to do with derivative.

    Thank you

    Julio

    I hope this help to clarify for you...

    It is not bringing conditional formatting.  Formatting conditional would change the format of a cell (or cells)... as the font, color, size, color cell background, or other formatting character is tics of a cell based on the contents of the cell

    You ask about including of the value of a cel another beach under certain conditions

    Here is an example:

    The first three rows are header lines.

    You must enter a valid date for the towing job.  Using the format "mm/dd/yyyy".

    C4 = IF (AND (DATEVALUE (A4) ≥DATEVALUE($B$1), DATEVALUE (A4) ≤DATEVALUE($B$2)), B4, "")

    It's shorthand dethrone select cell C4, and type (or copy and paste it here) the formula:

    = IF (AND (DATEVALUE (A4) ≥DATEVALUE($B$1), DATEVALUE (A4) ≤DATEVALUE($B$2)), B4, "")

    Select the cell C4, copy

    Select cells C4 at the end of the C column, paste

  • Smart album by date range does not select all the pictures, it should.

    I created a Smart Album with a range of the year.

    Some pictures appear in the Smart Album, but others do not, even though their information shows that their date corresponds to the range.

    I tried a repair of the photo library database, but that did not help.

    Try breaking the rule of date range: a buggy behavior reported in some language settings.

    This version shows more photos?

  • The smart Albums based on the date range cause app Crash Photos

    While I'm setting up a new Smart Album based on day of photos between 12/01/2015 and 31/12/2015 the Photos app closes with a crash. Cannot set the second date (the end date for this album). However, I can easily create a new Smart Album for next month (01/01/2016 and 01/31/2016). I create smart Albums, because the new Photos app does not like the old iPhoto does with my Photos from the photo gallery.

    How can I solve this? I don't have an album of December...? !

    You are in an area where the date format is different from the United States?  Earlier this year, we have seen small business issues have reported that rules for smart albums date range do not work with the primary language set to French or German.

    Try to change the primary system language to English with an English date format. Photos could be trying to read the 12/31/2015 as the 12th day of the month 31.

    Or use a different date based on 'before' rule and after.

  • Date range of family security

    Yesterday morning, I was able to select the day I wanted to see, but I checked and noticed an updated with no date range in the afternoon.  I want to keep track of that which is seen day after day, not a week.  Help?

    Hello

    Thanks for posting your query on the Microsoft Community.

    We understand that you want to track Web activity report in parental control
    on a daily basis. However, currently, the family safety activity reports Web can
    show only on a weekly basis.

    If you think that the display of the activity report on the Web on a daily basis is a great
    to have the option, you can submit Microsoft using the link below.
    https://Windows.uservoice.com/forums/265757-Windows-feature-suggestions

    Thank you.

  • HOW CAN I SORT MICROSOFT MONEY BY A DATE RANGE?

    I have Microsoft Money 2007 on my computer and I am trying to sort all of my information by date range. Janrary 2009 - January 2010, how do I do that?

    Hello

    Please repost in the silver forum

    Use this forum to discuss Microsoft Money. This includes money, more and more older versions.

    http://social.Microsoft.com/forums/en/money/threads

  • How to increase the available on report date range

    Hi gurus,

    On the BigBrother report page, we can define the date range considered. The date start and end on our BigBrother cannot be defined until 2010 (see this screen below). How can I report for 2012 and beyond?

    Any help will be very appreciated!

    Michael

    Micheal,

    Here's how I did it.

    I have the latest version for free.

    Modify the [BBHOME]/www/help/bb-rep.html file

    Line 95:

    And also to line 153:

    I hope this helps!

  • Copy files from specific date ranges in a Batch file

    I'm trying to copy files from a folder with many subfolders to another drive using a batch file. I want to copy the files in the date ranges specific (e.g. 01/01/2016 to 03/31/2016).

    I use this with Xcopy command:

    xcopy "C:\Users\John\Pictures\*.*" F:\BACKUP\Pictures/s/h/i/y

    It works, but I want to send groups of files by date for the different destination folders. I'm having a problem by specifying a date range in the command line.

    Is this possible with xcopy or robocopy? Does anyone know how to list the date rang in the command?

    Thankss in advance,

    John

    Hello

    Please contact Microsoft Community.

    I understand you wanted to know about the files and folders by using the copy command line.

    I suggest you go through the links below:

    Refer to the suggestion given by SpiritX MS MVP replied on 14 August 2010 and check if that helps:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/how-do-i-use-Xcopy-with-Windows-7/adab8f38-719F-451b-9500-c1d6ce385ad1?auth=1

    If the still the problem persists, I suggest you to post your query on TechNet:

    https://social.technet.Microsoft.com/forums/en-us/b11eb5a3-63dc-4636-82fd-ddc22fd8f2f8/cmd-file-to-copy-file?Forum=MDT

    Feel free to write us again with the status of the issue.

Maybe you are looking for