For the previous fiscal quarter date settings?

Hello people,
I have this requirement to choose the dates for the previous quarter. a fiscal quarter is usually January 2011 - March 2011. But in my case, the exercise should be December 2010 to February 2011 and if I check in June 2011 it must return to Mar 2011 until May 2011 and so on. So, how can I optimize to be able to select these dates i.e. 01/12/2010 until 28/02/2011 in where clause for the current date?
create table test_A (id int, col varchar(50),change_date date);

insert into test_A values(1, 'A',to_date('20101201 000000', 'YYYYMMDD HH24MISS'));
insert into test_A values(2, 'A1',to_date('20110122 000000', 'YYYYMMDD HH24MISS'));
insert into test_A values(3, 'A1',to_date('20110202 000000', 'YYYYMMDD HH24MISS'));
insert into test_A values(5, 'A1',to_date('20110306 000000', 'YYYYMMDD HH24MISS'));
insert into test_A values(6, 'A1',to_date('20110305 000000', 'YYYYMMDD HH24MISS'));
insert into test_A values(7, 'A1',to_date('20110307 000000', 'YYYYMMDD HH24MISS'));



select * from test_A
1     1     A     12/1/2010
2     2     A1     1/22/2011
3     3     A1     2/2/2011
4     5     A1     3/6/2011
5     6     A1     3/5/2011
6     7     A1     3/7/2011


I only want to see the following

1     1     A     12/1/2010
2     2     A1     1/22/2011
3     3     A1     2/2/2011
select  *
  from  test_A
  where change_date >= add_months(trunc(sysdate,'Q'),-1)
    and change_date <  add_months(trunc(sysdate,'Q'),2)
/

        ID COL                                                CHANGE_DATE
---------- -------------------------------------------------- ---------------
         1 A                                                  20101201 000000
         2 A1                                                 20110122 000000
         3 A1                                                 20110202 000000

3 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • Except for the previous version and after!

    Hello

    This is an application for all users to post in the Discussion forum OR. Please register your VI for the previous version (at least at 8,6) before posting because the people who know your best solution may not be the latest version that becomes difficult for them to solve.

    Then more easily and get the fastest solution...

    I have a comment.

    Code snippets.

    Use them wisely.

    Tone

  • How can I use internal clock case OR USB - 6259 BNC for the acquisition of digital data in my own big software?

    I want to integrate the ANSI C sample program ReadDigPort - ExtClk.c in my own big package.

    I want to use the internal clock of the BNC NI USB-6259 (.. 80 kHz 120 kHz).

    In the document:
    High speed M: Series Multifunction DAQ for USB - 16-bit, up to 1.25 MECH built-in BNC connectivity. / s,.
    is written:
    Or sample DI source clock: Any PFI, RTSI, HAVE sample or convert clock, AO, Ctr n out internal and many other signals sample clock
    The digital subsystem doesn't have its own dedicated internal synchronization engine. Therefore, a sample clock must be provided another subsystem on the device or from an external source.

    How can I use internal clock case OR USB - 6259 BNC for the acquisition of digital data in my own big software?
    With what other subsystem on the device can generate a source of the clock? How?

    It is possible to set a clock on an internal counter (for example ' Dev1/ctr0"):
    Creates channels to generate digital impulses that define the freq and dutyCycle and adds the channel of the task that you specify with taskHandle.
    DAQmxCreateCOPulseChanFreq (taskHandle, "Dev1/ctr0" units, clockName, idleState,
    initialDelay, freq, the duty cycle); works

    But it is not possible to drive this internal clock to a terminal (for example "/ PFI0/Dev1"):
    DAQmxErrChk (DAQmxCreateCOPulseChanFreq (taskHandle, "/ PFI0/Dev1", clockName, units, idleState, '))
    initialDelay, freq, the duty cycle); does not work: error DAQmx: measurements: type I/O of the physical channel does not match the type of I/O required for the virtual channel you create. Name of the physical channel: PFI0. Name of the virtual channel: clock

    The sample clock source can be derived from an external terminal (for example "/ PFI0/Dev1"):
    Sets the source of the sample clock, the sample clock rate and the number of samples to acquire or generate.
    DAQmxCfgSampClkTiming (taskHandle, "/ PFI0/Dev1", maximumExpectedSamplingRate, DAQmx_Val_Rising, ")
    DAQmx_Val_ContSamps, bufferSize); works. Acquire or generate samples until you stop the task

    But it is not possible to derive the internal counter of the clock (for example ' Dev1/ctr0"):
    DAQmxCfgSampClkTiming (taskHandle, "Dev1/ctr0", maximumExpectedSamplingRate, DAQmx_Val_Rising,
    DAQmx_Val_ContSamps, bufferSize); does not work. Error: Acquire or generate samples until you stop the task: make sure that the name of the terminal is valid for the specified device. See Measurement & Automation explore valid names of terminals. Property: Property of DAQmx_SampClk_Src: DAQmx_SampClk_ActiveEdgeSource device: Terminal Source Dev1: Dev1/ctr0

    Hi datafriend,

    using what it says is correct:

    Or sample DI source clock: Any PFI, RTSI, HAVE sample or convert clock, AO, Ctr n out internal and many other signals sample clock
    The digital subsystem doesn't have its own dedicated internal synchronization engine. Therefore, a sample clock must be provided another subsystem on the device or from an external source.

    This means that if you do not use an external signal as clock you can use the sample clock to HAVE it on board or at the output of the internal counter.

    There are also 2 ANSI C examples in this regard:

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4485

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4488

    So in both cases you have to use a fictitious task you need only for the generation of the internal clock (HAVE or CTR)

  • FAT32, exFAT, NTFS, which is the best for the recovery of deleted data?

    I have a usb 3.0 port (Kingston 100 3 16 GB) to store my important data. I read the article on this site: http://www.ntfs.com/ntfs_vs_fat.htm

    and they say recoverablitity of exFAT is "Yes if FAT active." I don't know what FAT and how to activate it, and what type of file system should I use (FAT, exFAT, NTFS) for the highest ability of data recovery if they are deleted?

    Hello

    Thanks for posting your query on the Microsoft Community.

    According to the description of problem, you're ready to recover the deleted data and would like to know some information about the FAT.

    A transaction-safe FAT (FAT) file system is a file system designed specifically to ensure the security of transactions for data stored on a disk. FAT requires a driver of specific hardware designed for the type of media on which the volume of FAT will exist. Assuming that there is a driver of material-specific secure transaction block, and that the driver provides interfaces to standard FAT file system, the FAT may work on removable media such as Compact Flash cards and digital cards secured, as well as media not removable, such as hard drives and NAND Flash memories.

    By design, the FAT file system is not a secured file transaction system. FATF may be corrupted if a write operation is interrupted in the middle of a transaction. Interruptions to occur due to loss of power or the suppression of the media. Fat is corrupted when the content of the FAT table does not have directory sections or data on the volume.

    I suggest you to return the article mentioned below and see if it helps you to recover lost or deleted data on your computer.

    Recover lost or deleted files

    As you disposed him to know FAT and his work, then here are some articles that might help you to learn more about FAT and its function.

    With the help of FAT (Windows CE 5.0)

    How to set up a system of FAT (Windows Embedded CE 6.0) file

    Transaction-Safe FAT File System (Windows IT 5.0)

    Implementation of FAT (Windows IT 5.0)

    Additional information:

    You can see the article mentioned below to learn more about NTFS and FAT32.

    Comparing the NTFS and FAT32 file systems

    Hope that the information provided is useful. Let us know if you have any concerns related to Windows. We will be more than happy to help you.

    Kind regards

  • Ive bought and downloaded adode acrobat Pro DC and its now asking me for the previous issue. I don't have it. He told me to uninstall the previous version of adobe so I did I don't have the password for the trail version more. How can I fix? I cannot ope

    Ive bought and downloaded adode acrobat Pro DC and its now asking me for the previous issue. I don't have it. He told me to uninstall the previous version of adobe so I did I don't have the password for the trail version more. How can I fix? I can't open any pdf on my computer now.

    Hi brets49833316,

    If you have purchased Adobe Acrobat Pro DC as an upgrade, then a serial number of the previous version which you have like Acrobat X or XI. If in the case where you have not bought one of these in the past, then you must buy Acrobat Pro DC as full version (US $449.00).

    In this scenario, you can return the version upgrade and purchase the full version. To return the Contact Customer Service

    Thank you

    Abhishek

  • I can't install my AD018640672 order number because you ask for the previous issue. Adobe came with my computer I don't have that. Can you help me!

    I can't install my AD018640672 order number because you ask for the previous issue. Adobe came with my computer I don't have that. Can you help me!

    Hi bobj39626549,

    We could certainly help you.

    If she asks for the previous version number, then you could acquire a version upgrade.

    You must purchase the full Acrobat version so that it can be installed and activated with the serial key.

    Hope that helps.

    Kind regards

    Ana Maria

  • Adobe Acrobat Pro XI serial number for the previous version, not for a product calling?

    Upgrade to Adobe Acrobat XI Pro to Adobe Acrobat Pro DC.  Get a message saying "... no product qualifying was not found on this computer.  Then entered the serial number and indicates the serial number for the previous version is not for a product calling?  I tried to enter the serial number in the accounts of my Adobe page section, but it does not recognize either.  Can you please help?

    Hello

    Please see error: "this serial number is not for a product calling it" | CS6 cs5, CS5.5,

    You can also view product describing was not found on this computer?

    Hope that helps!

    Kind regards

    Sheena

  • I need to re - install and reactivate my Office CS6.  I can't because I don't have the key code for the previous version of CS4.

    Had a boot disk failure.  New hard drive.  Re-install programs.  Reinstalled CS6, but cannot activate because I do not have a code for the previous version.  I have the key code for CS6.  It is listed in my Adobe account.  How can I turn it back on this program?

    Find the serial number of your Adobe product quickly

  • Function to move all the dates for the previous Monday

    Here's what I have:

    create or replace
    FUNCTION ToPreviousMonday
    (DATE_FIELD IN date)
    Date of RETURN
    AS
    BEGIN
    IF TO_DATE (DATE_FIELD, 'DAY') = 'SUN' THEN (DATE_FIELD)-6;
    Of ANOTHER trunc (DATE_FIELD, 'd.') + 1;
    END IF;
    END ToPreviousMonday;

    Don't compile.

    Basically, what I want to accomplish is in a SELECT statement, say something like (SELECT ToPreviousMonday (MyDateField) FROM MaTable) and cause the data back as the date of the previous Monday. NLS_TERRITORY is and will be for all the sessions going to Sunday as the day of the week 1.

    Pointers?

    Use:

    TRUNC (DATE_FIELD, 'IW')

    IW means ISO week which starts always on Monday regardless of NLS.

    SY.

  • Release date of variable text for the previous month?

    I'm automating a package of reports based on the data received on the following month, day 8. I need models to pull in the month statement , not the month I publish to the course. Is it possible to perform such a feat? See you soon.

    You simply define the content of a block of text with the variable.

    There are several ways to do so, but if you put something weird in the model as XXXXXXXX you can use a search/replace.

    var x = new Date();

    with (x)

    {

    setDate (1);

    setMonth (getMonth () - 1);

    }

    var months = new Array();

    months [0] = "Jan";

    months [1] = "Feb.";

    months [2] = "March";

    months [3] = "April";

    months [4] = "may";

    months [5] = "June";

    months [6] = "July";

    months [7] = "Aug.";

    months [8] = 'Seven.';

    months [9] = "October";

    months [10] = "Nov";

    months [11] = 'Dec.';

    var y = x.getFullYear ();

    var m = month [x.getMonth ()];

    var lastmonth = m + "" + y;

    myDocument var = app.activeDocument;

    Clear the find/change text preferences.

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    Set the search options.

    app.findChangeTextOptions.caseSensitive = false;

    app.findChangeTextOptions.includeFootnotes = false;

    app.findChangeTextOptions.includeHiddenLayers = false;

    app.findChangeTextOptions.includeLockedLayersForFind = false;

    app.findChangeTextOptions.includeLockedStoriesForFind = false;

    app.findChangeTextOptions.includeMasterPages = false;

    app.findChangeTextOptions.wholeWord = false;

    Search the document for the string "XXXXXXXX" and change it to "text".

    app.findTextPreferences.findWhat = "XXXXXXXX";

    app.changeTextPreferences.changeTo = lastmonth;

    myDocument.changeText ();

    Clear the find/change text preferences after the search.

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    That save you and run when you open the document.

    Read the Guide to the script is a good thing to do no matter if it works for you, this time.

    Don't forget to mark this as replied to what works for you.

  • Change the Date Format for the previously imported items

    Hi, I'm a newbie to Lightroom with 3.3 being my first experience.  I looked in quite a few threads looking for my question, so I apologize in advance if this has been discussed before.

    I have recently imported/moved 45 GB of pictures in my library and changed the Format of the Date in the way that I thought that I would - I was wrong.  I imported using this format:

    2011-02-02

    So, I have hundreds of folders listed as:

    2011 02-02 148 (pics)

    2011-02-03 2 (pics)

    2011-02-15 15 (pics)

    2011-03-01 1 (pic)

    2011-03-02 30 (pics)

    etc...

    I would like to look like her to have folders roots with the years, months and days then.  I guess I need to format:

    2011/2011-02-02

    Say that it's the right format I expected to have imported with, is there a way to change this without having to delete the catalog and import it back all my photos?

    Thanks for your time

    If you want the same files under a folder parent 2011 instead of all at the same level?  You can add the 2011 folder and then drag and drop in the files LR Panel to pull those records in there.

    If you want years then month then the days you want the one with all the slashes - 03/02/2011

    That said, it's not like you're shooting a lot, then I'd go to this subject a little differently if you have piles of records to settle.  I have a folder of 2011 and simple month folders in this (01, 02, something like that) and then I would use metadata filters to find all the photos of January and drag the photos themselves in January record and repeat for the other 11 months.  Once you have done this, you can remove empty folders of day.  For small numbers, I wouldn't worry about breaking it down into a folder per day, so in the import dialog box in the future I would just select 2011/02.  You like.

    If you have changed pictures in LR yet, it would be quicker to start a new catalog and re-import and leave the LR to move them into your chosen folder structure.

  • Where that we manage for the display and entry date formats

    the specification of the user that is displayed as DD-MON-YYYY dates. Is there a config or properties file that contains the date format for display? Is there a drop down calendar which can be positioned next to an input field to date for a question on a screen?
    Thank you
    Allan

    Hi Allan,

    Just had a look at this takeover bid 10.1 on my machine.

    I noticed that for an attribute date as on a screen, when you use Input type = Year, Month and Day edits (in the file screens), it seems to display the three drop-down lists in the same order (day, month, year), regardless of what's been defined in the configuration line "input-date-formats" in messages. file .properties (locale).

    However, I was not sure of your email if the DD-MON-YYYY format was necessary for the entriesto date, or just for the display of date output. If the latter, then using the following in your messages. (place) .properties file...

    output-date-format = yyyy-MMM-dd
    

    ... will translate dates displayed like this: 1980-Jan-27

    To force the OWD to accept only dates of entry of user in the format '1980-Jan-27' then you can edit the line input-date-formats of configuration:

    input-date-formats = yyyy-MMM-dd
    

    ... However, it is rare to restrict the dates of entry into a single format. As you will see in the messages. (locale) .properties file entry-date-formats is set to a combination of common entry to the regional settings date formats, in addition to the ISO international date format (YYYY-MM-DD, e.g. 1980-01-27).

    See you soon,.
    Jasmine

  • Yosemite does not support AppleWorks. What are the alternatives for the light, drawing, spreadsheets, data management?

    No more Appleworks in Yosemite. What software do I need to do the simple drawing, spreadsheets, data management?

    Yes, it's old enough ;-)

    For drawing, how about something like Acorn (on the Mac App Store)? For calculation and processing sheets, there are numbers and Pages available at Apple, the Mac App store.

  • cDAQ for the continuous acquisition of data faster

    Hello

    I've only done very slow with LabVIEW data acquisition and I was wondering what the most fast (conservatively faster I'm not pushing the limits) data acquisition and recording of data possible on compact DAQ hardware? and the advantage of switching to a cRIO of a cDAQ really just for more reliable speed and data acquisition? I am interested on 30kS/s channels more analog input 5.

    Thank you very much!

    Rates are feasible, and you can stream to disk. It is only when you save in a text file that you need to start to worry about the use of a design of producer/consumer and a queue (in general).

    I'd be too concerned about real-time unless you do some kind of control loop where the reactions must be precisely timed (once again, in general).

    For very high acquisition rate (high MECH. / s), OR sell scanners that connect with USB in order to have some distance to go before you should start worrying.

  • Except for the previous version of 2015 caused problems

    Hi all

    I made a race of CLD practice using the example of irrigation system. I I built in 2015 of LabVIEW and saved for a previous version of LabVIEW 2014 before posting in the forum of Certification for the comments. When it was opened by another member through 2014, delimited reading Spreadsheet.vi is not found. I can't reproduce the error because I do not have an installation of 2014. The original thread is HERE. I enclose my original draft of 2015 as "Registered for previous" version 2014. Also attached is a screenshot of the attempt to open the 2014 version. This could be a problem with the backsave?

    Thank you all.

    Dan

    Read from a spreadsheet file is obsolete and replaced by reading delimited spreadsheet.  It is actually planned to break.

Maybe you are looking for