Analysis of Date with Mr. YYYY and in between

Hello

[Oracle 11g]

I got a table with a Date in it. Lets called him Testdate and something called startmonth and endmonth.

Looks like the element (varchar2)

MM YYYY 03.2012 te and is a


I want to see all the data between the departure and endmonth.

First, I tried to convert my orignial table date:
 SELECT distinct TO_CHAR(TESTDATE, 'MM'||'.'||'YYYY')
 FROM mv_auswertung;
It works:
TO_CHAR(TESTDATE,'MM'||'.'||'YYYY')
02.2012
12.2012
01.2012
But now, I'm trying to get all the data between the start and enddate:
Select *
from mv_auswertung 
where 
TO_CHAR(TESTDATE, 'MM'||'.'||'YYYY') between 
to_CHAR(:P7_startmonth) and to_char(:P7_endmonth)

Hello

Thorsten wrote:
Hello

[Oracle 11g]

I got a table with a Date in it. Lets called him Testdate and something called startmonth and endmonth.

Looks like the element (varchar2)

MM YYYY 03.2012 te and is a

Soething is not found in the end of the line above.

I want to see all the data between the departure and endmonth.

First, I tried to convert my orignial table date:

SELECT distinct TO_CHAR(TESTDATE, 'MM'||'.'||'YYYY')
FROM mv_auswertung;

It works:

TO_CHAR(TESTDATE,'MM'||'.'||'YYYY')
02.2012
12.2012
01.2012

But now, I'm trying to get all the data between the start and enddate:

Select *
from mv_auswertung
where
TO_CHAR(TESTDATE, 'MM'||'.'||'YYYY') between
to_CHAR(:P7_startmonth) and to_char(:P7_endmonth)

The string "04.1999' comes between the chains ' 01.2013' and ' 06.2013', because «04' comes from '01' year ' 06';»»» the rest of the channels are not relevant for this comparison.

But what is TESTDATE? The first argument of TO_CHAR is supposed to be a DATE. If TESTDATE is a DATE, then you can say:

testdate  BETWEEN  TO_DATE (:p7_startmonth, 'MM.YYYY')
       AND        TO_DATE (:p7_endmonth,   'MM.YYYY')

Remember that the day of default of ringworm s 01, nd default schedules, minutes, and seconds are 00, so

TO_DATE ('04.2013', 'Mm.YYYY')

is midnight, April 1, 2013, i.e. the beginning of the month, you may need to l as a

WHERE   testdate >= TO_DATE (:p7_startmonth, 'MM.YYYY')
AND      testdate <  ADD_MONTHS ( TO_DATE (:p7_endmonth,   'MM.YYYY')
                                 , 1
                      )

According to your values and your needs.

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
If you need parameters (like: p7_startmonth) in the problem, and then after a few sets of parameters, and the results you want for you same SAMPLES for each game.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum {message identifier: = 9360002}

Published by: Frank Kulash on April 17, 2013 07:00

Tags: Database

Similar Questions

  • Can I introduce a few relationships in data with the views and the Table maker?

    Hello. I have db with lots of views and tables. Can I introduce a few relationships in maker data with Tables and views? I have to configure PK and FK for my tables and views if I want to see relationships? I just started with the Data Modeler. Thank you for your help.

    Hello

    If you import your database Tables (Import / Data Dictionary), foreign keys defined in your database will be also imported.

    He is also a foreign key discovery tool in maker of data that can help you identify possible FK relationships and add them to your model.

    To use it, right click on the entry for your relational model in the tree view of the browser and select the foreign keys to discover on the menu drop down.

    Note that data Modeler does not support PKs and FKs on views.

    David

  • Transfer data with datasocket read and FILE protocol in LabVIEW

    High,

    I'm trying to transfer the ASCII file with datasocket read function by using the FILE protocol. It works for files on the local machine, but does not work for machines on the network.

    What is a good sequence for data transfer on the network?

    THX

    Trajan

    Simply boils down to permissions on the file. I did a shared directory on my local machine and it worked fine with a colleague.

    [For example: file:\\ \ToBeShared\SineData.txt[text] where I have a shared folder on the directory. It could also be the firewall.

  • Mozilla is sharing data with government agencies and if so what data?

    I'm looking to switch to a provider that values privacy and has the honesty to say 'no' to the agencies that request data from personal illegally. Mozilla protecting the privacy of their users? This isn't a matter of degree; It's a Yes or no answer.

    Hello, here is the mozilla privacy policy: https://www.mozilla.org/legal/privacy/firefox.html

  • Why my original Apple Watch do not update 3.0? My information shows my software is up to date with 2.2 and 3.0 is now available. Is this only for new watches?

    My Apple Watch shows that I'm up-to-date 2.2.2. Today 3.0 is available. Is this only for new watches?

    No - watch OS 3 is available for all models of Apple Watch.

    Be patient in waiting for the watch OS update 3 to become available, but start by updating your iPhone on iOS 10:

    Update the software on your iPhone, iPad or iPod touch - Apple Support iOS

  • I got my system up to date with Office 2007 and am running Microsoft Windows XP Professional. Now each email that I created and it checks spelling that he wants to change all the words to the French spelling. How do I change so it checks in English?

    My words in my e-mails are English chanded the French when I use the spellchecker.  How to check in English?

    From: Bruce Hagen MVP OE - you have more correction spell checking capabilities in some languages in Outlook Express 6.0 after you install 2007 Microsoft Office system

    http://support.Microsoft.com/kb/932974

    Office 2007 breaks OE spell. A free spell-checking the download is the easiest way to get around this. Some free spell check programs.

    Vampirefo - http://www.majorgeeks.com/download.php?det=2952

    TinySpell - http://www.tinyspell.m6.net/ (check spelling while typing).

    Or from this blog - http://pschmid.net/blog/2006/11/13/80
    MS - MVP - Elephant Boy computers - don't panic!

  • The GPS data with other analyzed data record

    Hello!

    I am a new user of DASYLab and not very good with coding, so please bear with me! I try to record (timestamp, latitude, longitude) already analysed GPS data with other data (accelerometer, etc.) in the same. DDF file. Right, GPS analysed is now sent through a series of three demultiplexers for each signal and only 1 of 16 channels, reducing the size of the output data. This data is then saved in a. The CAD file. Other data on average, recorded in one. DDF file, then saved another. The CAD file. We used to compare the data from the GPS and other devices by comparing timestamps.

    I would like to save all data to a file, either. DDF of. CSA (.) DDF would be preferable).

    When I try to add more channels in the. DDF save the module after the demultiplexer black box and GPS data to it, I get an error saying "the data to an entry in this module are the wrong type." I also receive this error when trying to send the data GPS to the. CSA Save module. I learned that this means that the size of the files is not the same of this thread. My question is, how can I make sure that the data have the same characteristics of time so I can save to the same file?

    If you need more information I would be happy to provide it, I apologize if I have something important to go.

    Thanks for reading,

    etdiv

    That's what I needed. Your time is the driver. In the RS232 input module, click the Options button.

    Select the measurement of output value, and then click the button on the time Base and select sync/time Base driver.

    That should allow you to write to the DDF file.

  • Synchronize the dictionary of data with model only works for models imported?

    When I imported data dictionary model (file-> import-> data dictionary) then in relational model the two buttons "Synchronize Data with Model Dictionary" and "Synchronize model with Data Dictionary" works very well.

    But when I model created from scratch and I'm clicking on the buttons "Synchronize data dictionary with the model" or "Synchronize model with Data Dictionary" nothing happens.

    It works only for models imported?

    (Data model EA 3.3)

    Hello

    Yes, Synchronize only works for objects that were imported to the original (like Synchronize uses the information entered during the import to determine which database connection and the database object to compare to).

    If your model is not imported, you can achieve the same effect as follows:
    -Open the template in Data Modeler and also open the relevant physical model.
    -Do an Import of data dictionary, select the objects you want to compare with that.

    After the import phase, this will display the dialog box to compare, showing the differences between the objects imported from the database and your model.

    Note that if you intend to generate the DDL to update your database of the difference (as in "synchronize with Model Data Dictionary"), you must select the "Swap Target Model" option in step 2 (select database schema) data dictionary import wizard.

    David

  • Why import data if ready schema and index create, increase in Undo TableSpace

    I have a problem importing data.
    When I export data don't have schema import include the index schema.
    And then I import the schema ready.
    When I import data, I find this Undo TableSpace increase very fast.
    I have therefore two tests.
    1. IMPORT of data and index, every thing ok look
    2 import a schema includes index
    and then import data. Undo Tablespace very rapid increase

    If you mean undo tablespace increase in order to read consisten read.

    N ° cancel space use increases due to the DML. (requests for consistent readings read undo, they generate no cancellation to grow)

    so you're saying that redo log appear, rollback undo segment will increase.

    N ° increase in written cancellations results increase in roll forward.

    IF we import large data, we must export data with the index and import data right now

    If you import large data, you must create the indexes after the data is imported. If the index definitions are included in the export, the default behavior is that import will create them once the data is imported. To do this, undo lower for indexes.
    Note This will generate redo for the creation (but does not cancel and therefore not generate recovery for cancellation). You can avoid this by manually running CREATE INDEX... NOLOGGING - but it means you need to get and modify the scripts CREATE INDEX.

    Hemant K Collette

  • EXTRACT DATES WITH THE HELP OF TWO DATES AND THE BOX

    Hello

    I HAVE 2 DATE PICKER ITEMS
    : P1_ARRIVAL_DATE AND: P1_DEPARTURE_DATE

    AND I HAVE 7 ITEMS in BOXES DAY it return values are 'Y '.

    : P1_MON
    : P1_TUE
    : P1_WED
    : P1_THU
    : P1_FRI
    : P1_SAT
    : P1_SUN

    as I choose date: P1_ARRIVAL_DATE AND: P1_DEPARTURE_DATE
    AND THE DAY, AS: P1_MON, ONLY THE DATES HAVE TO RETURN WHO HAVE MONDAY AS DAY BETWEEN: P1_ARRIVAL_DATE AND: P1_DEPARTURE_DATE.


    FOR EXAMPLE IF I CHOOSE THE DATE: P1_ARRIVAL_DATE AS 07_NOV_2011 AND: P1_DEPARTUE_DATE AS: P22_NOV_2011 AND IT HAS 3 MONDAY BETWEEN THESE DATES
    RESULT SHOULD BE DISPLAY AS
    ======================================
     ARRIVAL DATE-------ARRIVAL DATE+6
    ============================
     07_NOV_2011 ---     13_NOV_2011       // THESE ARE MONDAY DATES
    14_NOV_2011 ---     20_NOV_2011     
    21_NOV_2011 --      28_NOV_2011 
    CAN I CHOOSE MORE THAN ONE CHECK BOX AT THE SAME TIME
    FOR EXAMPLE IF I CHOOSE: P1_MON AND: P1_TUE, THE RESULT SHOULD BE

    ARRIVAL DATE-------ARRIVAL DATE+6
    ============================
     07_NOV_2011 ---     13_NOV_2011   
     08_NOV_2011 ---     14_NOV_2011      
    14_NOV_2011 ---     20_NOV_2011      // MONDAY AND TUESDAY DATES
    15_NOV_2011 ---     21_NOV_2011  
    21_NOV_2011 --      27_NOV_2011
    22_NOV_2011 ---     28_NOV_2011 
    HOW CAN I DO THIS? PLEASE HELP SOLVE THE PROBLEM.



    THANKS and GREETINGS
    CORINE

    X the problem you see is a misunderstanding on my part about what is the date of arrival date of departure... it's inverse reasoning: at your arrival is before departure (and I got it on the other hand, the departure before arrival (:-))

    But there is also a flaw in the code (instead of the Date of arrival by using the select sysdate).

    Please run the code like this:

    with dates as
    (select to_date(:P1_ARRIVAL_DATE,'DD-MON-YYYY')+level-1 as day from dual
     connect by level <= to_date(:P1_DEPARTURE_DATE,'DD-MON-YYYY') - to_date(:P1_ARRIVAL_DATE,'DD-MON-YYYY')  +1
     )
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Mon' and :P1_MON = 'Y'
    union
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Tue' and :P1_TUE = 'Y'
    union
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Wed' and :P1_WED = 'Y'
    union
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Thu' and :P1_THU = 'Y'
    union
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Fri' and :P1_FRI = 'Y'
    union
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Sat' and :P1_SAT = 'Y'
    union
    select day, to_char(day,'Dy') from dates
    where to_char(day,'Dy') = 'Sun' and :P1_SUN = 'Y'
    

    for the period from 01 to 15 November 2011, with P1_TUE and P1_FRI, flag in there, I got this result:

    DAY      TO_CHAR(DAY,'DY')
    11/01/2011     Tue
    11/04/2011     Fri
    11/08/2011     Tue
    11/11/2011     Fri
    11/15/2011     Tue
    

    To simplify (can only test inside the apex report, could not run code in SQL Wkshop):

    with dates as
    (select to_date(:P1_ARRIVAL_DATE,'DD-MON-YYYY')+level-1 as day from dual
     connect by level <= to_date(:P1_DEPARTURE_DATE,'DD-MON-YYYY') - to_date(:P1_ARRIVAL_DATE,'DD-MON-YYYY') +1
     )
    select day, to_char(day,'Dy') from dates
    where v('P1_'||to_char(day,'DY')) = 'Y'
    

    Published by: Kléber M on November 14, 2011 05:06

  • How could a routine walk-run? Inside, Indoor walk or another run? I do this routine outdoors with Gps first so that I'm not kidding my calibration data? Help please and thank you!

    How could a routine walk-run? Inside, Indoor walk or another run? I do this routine outdoors with Gps first so that I'm not kidding my calibration data? Help please and thank you!

    Hello

    Choose indoor walk or run Indoor (it does not matter which) to an indoor walk-run routine.

    Even if Apple Watch does not currently offer as a workout interval training, choose one of these allows the most appropriate data sources (which are the same for market and short) to use to track your training.

    If walking or running, the accelerometer is used to estimate pace and the distance (allow your arms swinging naturally) as well as the frequency heart sensor for the estimation of calories burned.

    Run or walk inside will not affect your calibration data. Calibration is based on the GPS of the iPhone data and is only held during the outdoor walking training or race outdoors when the iPhone combined is taken along.

    More information:

    Use of the workout on your Apple Watch - Apple Support

    Calibrate your Apple Watch for better accuracy of training and activity - Apple Support

  • play sounds temporary and file of your choice when reading data with VISA functions?

    Hello.

    I read the function of reading data with VISA and then I use as multiple functions to display data on the graph. everything is OK.

    now, I want to play a sound specified (like a song in my desired folder 3s) signal which cross above the specified value range. then after the desired time, it will wait still new cross above the specified value and this repetition of the procedure until I stop the program.

    Data MCU is from and it does not stop when his game system and what system of incoming data for this part (his play) will ignore them pending that outdated.

    I use this for reading data and part VI mentioned which belongs to her is empty and I don't know what I have to do?

    altougth I use an another while loop for his apartment because I want to save time CPU.

    Thank you.

    I recommend you do the data type of the notifier a cluster that contains a path and a numeric (double).  The path indicates the reader what file to play.  Digital is the duration.

    Now in a way a bit complicated, but really good stop your second loop.  Do not use a second notification.  Instead, send the normal notification but not use a path for the path in the cluster.  Your second loop can write a check for the path of a not and stops when that is received.

  • Generate data with 6722 and reading back with 6221 - it visualization with a virtual oscilloscope

    Hello

    I generate an analog signal with the 6722 and want to read with the 6221. The results shall be included in the virtual oscilloscope. My problem is that I don't know where to put the signal-chart and that I really need to use type. The second problem is that I have no idea how do I choose a time scale and where and how to define. Finally, I have that image that I get on the real oscilloscope with data generated by 6722 on the virtual oscilloscope with the 6221. Initially, the oscilloscope should have no (mode of operation only) trigger as the 6221 has only a digital triggering.

    For the moment, I have a loop that generates the signal using a sequence. Now, the question is where to put the signal-chart and what settings should I use for reading back information (1 sample, continuous, etc.).

    Thank you

    Verena

    Hi db2nc,

    Here is a link for an example of our community. It shows you an example with which you can generate a signal on output and gain on a different entry.

    I think that's what you want to archieve.

    Loopback synchronized analog output of analog input

    concerning

    Michael

  • Almost any time I use the usb climb on my computer (with flash or ipod players) it freezes and crashes windows. I am up to date with drivers with Microsoft and HP, what can I do to stop this?

    I have no problem with the usb drives but in recent times, this happens all the time.  I can go into Device Manager and uninstall my usb drivers and allows that, sometimes, but it's a temporary solution.  I am up to date with drivers with Microsoft and HP, what can I do to stop this?

    Hello

    You can try to use your boot USB storage device and check if that helps. A clean boot helps eliminate software conflicts.

    The following link has steps showing how to perform the clean boot. http://support.Microsoft.com/kb/929135  
    (1) perform the clean boot
    i. Click Start, type msconfig in the search box and press ENTER.
    If you are prompted for an administrator password or a confirmation, type the password, or click on continue.
    II. in the general tab, click Selective startup.
    III. under Selective startup, clear the check box load startup items.
    IV. click the Services tab, select the hide all Microsoft Services check box and then click Disable all.
    v. click OK.
    VI. When you are prompted, click on restart.
    VII. after the computer starts, check if the problem is resolved.

    (2) enable half the services
    (3) determine whether the problem returns
    (4) enable half of the startup items
    (5) determine if the problem returns
    (6) repeat the steps above until you find out which program or service is causing the issue
     
    After you determine the startup item or the service that is causing the problem, contact the manufacturer of the program to determine if the problem can be solved. Or, run the System Configuration utility, and then click to clear the check box of the element of the problem.
     
    Note: Please make sure that the computer is configured to start as usual by following step 7 of article http://support.microsoft.com/kb/929135 .

    Reset the computer to start as usual

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:
    (i) click Start, type msconfig.exe in the start search box and press ENTER. If you are prompted for an administrator password or for confirmation, type your password, or click on continue.
    (II) on the general tab, click the Normal startup option, and then click OK.

  • I need to know the file current date/time number stamp and the version of "spoolsv.exe" in Vista Home Premium 32-bit with SP2.

    I need to know the file current date/time number stamp and the version of "spoolsv.exe" in Vista Home Premium 32-bit with SP2. My spooler file got corrupted and I need to know what that the stamp of date/time on the latest version of the file: spoolsv.exe. I did a search on my hard drive and found 8 copies of the file with 7 different dates. I need to know which copy in my file C:\windows\system32\. I suspect that the problem was caused by some kind of malware. I think that some of the different versions on my machine of the initial installation of the Vista, SP1 and SP2. 3 copies that would explain. I tried all the suggestions in this forum and several others. I tried sfc/scannow and it simply replaces the corrupted file by another. I understand how works this file and a simple copy will do the trick if I knew that the file to use. I know that I don't want to go back to the first version of 2006.  BTW... my symptoms are all my printers have disappeared, and when I try to 'add a new printer' I get an error message saying that my spooler service does not work. When I opened my services window it shows that indeed, he is arrested, but I will not start because the description column contains only the code garbled machine indicating that the file is corrupted, or it may contain a virus. I had been using F-Prot until this virus got by and now I use AVG. I scanned my machine with several cleaning packages and it is is more infected, but I worry that from this corrupt file grow something. I know that the problem is not with my printers or drivers, because everyone on my home network can print on all of my printers. None of the people I know are on Vista 32 bit. They are all running System 7 or XP. I have XP, except that a few years ago I suffered from the "Syndrome of Pepsi" on my laptop and when I bought a new HP, it came with Vista.

    Version 6.0.6002.18294

    Day 17/08/2010

    Duration 14:11

    Duration may vary in different time zones.

Maybe you are looking for