Date related question

I am trying to get the events from this (date,month,year) to this (date,month,year) but unable to write sql statement
My tables:
SQL> desc event
Name Null? Type
E_ID NOT NULL NUMBER(14)
EVENT VARCHAR2(3110)
SQL> desc event_time
Name Null? Type
E_ID NUMBER(14)
EYEAR NUMBER(5) //e.g. 2008
EMONTH NUMBER(3) //e.g. 1 to 12
SDATE NUMBER(3) //Start day e.g. 1 to 31
EDATE NUMBER(3) //End day e.g. 1 to 31
select
     eyear,emonth,event
from
     event a, event_time b
where
     a.e_id=b.e_id
and
     ?????????????? //Her I am facing problems
Kindly help me
Thanks & best regards

Grrr. IT is not a good way to design dates ...
But anyway, the missing condition could be as:
and to_date(eyear||emonth||sdate','yyyymmdd') > YOURDATE
and to_date(eyear||emonth||edate','yyyymmdd') < YOURDATE
This to look for the records being within the YOURDATE. If you want to look for the records that start at YOURDATE1 and finish at YOURDATE2 Put this:
and to_date(eyear||emonth||sdate','yyyymmdd') = YOURDATE 1
and to_date(eyear||emonth||edate','yyyymmdd') = YOURDATE2
Otherwise, deal with these examples.....

Similar Messages

  • Simple java date related question

    Hi Friends,
    I have written this custom date class that compares two dates. The user can enter any number of days,and it should calculate the next date,is that possible???
    public class Date implements Comparable {
         private int month, day, year;
         public Date(int m, int d, int y) {
              month = m;
              day = d;
              year = y;
         public int compareTo(Object o) {
              Date a = this;
              Date b = (Date) o;
              if (a.year < b.year) return -1;
              if (a.year > b.year) return 1;
              if (a.month < b.month) return -1;
              if (a.month > b.month) return 1;
              if (a.day < b.day) return -1;
              if (a.day > b.day) return 1;
              return 0;
         public String toString() {
              return month + "/" + day + "/" + year;
         public static void main(String[] args) {
              Date d1 = new Date(21, 03, 2007);
              int days = Integer.parseInt(args[0]);
              System.out.println("New date is:"); // Need to print new date
    Expected output:
    java Date 30
    New date is: 04/20/2007If this is not possible with this class,how can we do this, any ideas.
    Your help would be appreciated.
    Thanks

    Hi,
    Try this code out:
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.JOptionPane;
    public class SimpleDate {
         private int month, day, year;
         public SimpleDate() {
              Date date = new Date();
             String myString = DateFormat.getDateInstance().format(date);
             StringTokenizer tokens = new StringTokenizer(myString, "/");
             day = Integer.parseInt(tokens.nextToken());
             month = Integer.parseInt(tokens.nextToken());
             year = Integer.parseInt(tokens.nextToken());
         public SimpleDate(String stdate) {
              try {
                   StringTokenizer tokens = new StringTokenizer(stdate, "/");
                   day = Integer.parseInt(tokens.nextToken());
                   month = Integer.parseInt(tokens.nextToken());
                   year = Integer.parseInt(tokens.nextToken());
              catch(Exception e) {
                   Date date = new Date();
                  String myString = DateFormat.getDateInstance().format(date);
                  StringTokenizer tokens = new StringTokenizer(myString, "/");
                  day = Integer.parseInt(tokens.nextToken());
                  month = Integer.parseInt(tokens.nextToken());
                  year = Integer.parseInt(tokens.nextToken());
                   JOptionPane.showMessageDialog(null, "Invalid String,\nDate set to current", "Invalid String", JOptionPane.ERROR_MESSAGE);
         public SimpleDate(int d, int m, int y) {
              month = m;
              day = d;
              year = y;
         public int compareTo(Object o) {
              SimpleDate a = this;
              SimpleDate b = (SimpleDate) o;
              if (a.year < b.year) return -1;
              if (a.year > b.year) return 1;
              if (a.month < b.month) return -1;
              if (a.month > b.month) return 1;
              if (a.day < b.day) return -1;
              if (a.day > b.day) return 1;
              return 0;
         private int getNumOfDaysInMonth() {
              boolean leap = false;
              int days = 30;
              if (year % 4 == 0) leap = true;
              if ((month == 1) | (month == 3) | (month == 5) | (month == 7) |
                        (month == 8) | (month == 10) | (month == 12)) {
                   days = 31;
              if ((month == 4) | (month == 6) | (month == 9) | (month == 11)) {
                   days = 30;
              if (month == 2) {
                   if (leap) {
                        days = 29;
                   else days = 28;
              return days;
         public void addDays(int nums) {
              while (nums > getNumOfDaysInMonth()) {
                   nums = nums - getNumOfDaysInMonth();
                   addMonths(1);
              day = day + nums;
              while (day > getNumOfDaysInMonth()) {
                   day = day - getNumOfDaysInMonth();
                   addMonths(1);
         public void addMonths(int nums) {
              while (nums > 12) {
                   nums = nums - 12;
                   addYears(1);
              month = month + nums;
              while (month > 12) {
                   month = month - 12;
                   addYears(1);
         public void addYears(int nums) {
              year = year + 1;
         public int getDay() {
              return day;
         public int getMonth() {
              return month;
         public int getYear() {
              return year;
         public String toString() {
              return day + "/" + month + "/" + year;
    }I have swapped the day and month around from mm/dd/yyyy to dd/mm/yyyy
    but otherwise its still the same basic code

  • I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.​Please help me for that.

    I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.Please help me for that.
    1.)If i am using the continuous output mode.and the size of generated data is less than 32 MB.If i want to preload the memory,what should i do?I want that first of all i load all my data to onboard memory & then i want to make start the transfer between 6534 & peripheral.Is it possible?As per me it should be.Plz tell me how should i do this?I think that in normal procedure the transfer between 6534-peripheral & outputting data from pc buffer to onboard memory works parallely.But i don't want this.Is it poss
    ible?
    (2).Similarly in finite input operation(pattern I/O) is it possible to preload the memory and then i read it?Because i think that the PC memory will be loaded automatically when 6534 acquires the data and then when we use DIO read vi the pc buffer data will be transferred to application buffer.If this is true,i do not want this.Is it possible?
    (3) One more question is there if i am using normal operation onboard memory will be used bydefault right?Now if i want to use DMA and if i have data of 512 bytes to acquire.How will it work and how should i do it?Please tell me the sequence of operations.As per my knowledge in normal DMA operation we have 32 Bytes FIFO is there so after acquisition of 32 bytes only i can read it.How it will known to me that 32 bytes acquisition is complete?Next,If i want to acquire each byte separately using DMA interrupts what should i do?Provide me the name of sourse from which i can get details about onboard memory & DMA process of 6534 specifically
    (4).In 6534 pattern Input mode,if i want to but only 10 bits of data.and i don't want to waste any data line what should i do?

    Hi Vishal,
    I'll try to answer your questions as best I can.
    1) It is definitely possible to preload data to the 32MB memory (per group) and start the acquisition after you have preloaded the memory. There are example programs on ni.com/support under Example Code for pattern generation and the 6534 that demonstrate which functions to use for this. Also, if your PC memory buffer is less than 32MB, it will automatically be loaded to the card. If you are in continuous mode however, you can choose to loop using the on-board memory or you can constantly be reading the PC memory buffer as you update it with your application environment.
    2) Yes, your data will automatically be loaded into the card's onboard memory. It will however be transferred as quickly as possible to the DMA FIFO on the card and then transferred to the PC memory buffer through DMA. It is not going to wait until the whole onboard memory is filled before it transfers. It will transfer throughout the acquisition process.
    3) Vishal, searching the example programs will give you many of the details of programming this type of application. I don't know you application software so I can't give you the exact functions but it is easiest to look at the examples on the net (or the shipping examples with your software). Now if you are acquiring 512 bytes of data, you will start to fill your onboard memory and at the same time, data will be sent to the DMA FIFO. When the FIFO is ready to send data to the PC memory buffer, it will (the exact algorithm is dependent on many things regarding how large the DMA packet is etc.).
    4) If I understand you correctly, you want to know if you waste the other 6 bits if you only need to acquire on 10 lines. The answer to this is Yes. Although you are only acquiring 10 bits, it is acquired as a complete word (16bits) and packed and sent using DMA. You application software (NI-DAQ driver) will filter out the last 6 bits of non-data.
    Hope that answers your questions. Once again, the example code on the NI site is a great place to start this type of project. Have a good day.
    Ron

  • PM/EAM related questions posted in PLM forum

    Hi,
    I was going through some of the threads available in PLM forum, but to my surprise, most of the threads posted are related to PM, which should have been posted in EAM forum. It was clearly mentioned by the moderator in one of the sticky thread [PLM-Forumsplit - Please ensure you are using the right forum|PLM-Forumsplit -  Please ensure you are using the right forum;
    Questions regarding Plant Maintenance (PM) or Customer Service (CS) are discussed in the Enterprise Asset Management (EAM) forum
    forums - posts will be moved to the right forum.
    Please ensure your are opening a new thread in the right forum
    Despite the clear instructions given my the moderator, PM related questions are still posted to PLM forum and some of the active participant of EAM forum answers these questions in PLM forum. It would be nice if those threads are moved to appropriate forum, so that the relevant informations are available under one forum, also, PLM forum should be monitored regularly and inappropriate threads are to be moved to their respective forum.
    Few PM related threads posted recently in PLM forum:
    [Change PR for External order|Change PR for External order;
    [BAPI or Function Module to Complete Maintenance calls in IP10|BAPI or Function Module to Complete Maintenance calls in IP10;
    [delete material from PM order|delete material from PM order;
    [Message no. IW056 Work center change --> default data redefined|Message no. IW056 Work center change --> default data redefined;
    [Component in Task list not reflecting in maintenance order|Component in Task list not reflecting in maintenance order;
    [Deleted functional location/equipments|Deleted functional location/equipments;
    [PM orders not listing components from material BOM|PM orders not listing components from material BOM;
    [Completion date in Maintenance Plans in IP10|Completion date in Maintenance Plans in IP10;
    I had used abuse reports for some, but numbers of such posts are many.

    I hate to say this, but I often see the same thing, and I've never been able to figure out exactly what triggers selectability vs. non-selectability, but I suspect some of it has to do with tranparency flattening in particular, and possibly text wrap in cases where that comes into play. ID optimizes the PDF it creates, I think, and that might cause text, or even images, to be broken into chunks in funny ways. It occurs to me that turning off optimzing for fast web view might help in this regard.

  • Please post documentation-related questions or comments on the

    Please post documentation-related questions or comments on the Performance Management Applications {forum:id=1318} forum     
    http://forums.oracle.com/forums/forum.jspa?forumID=1318

    I just got a call today that I reached my 300GB limit for the month.  I called and got a pretty rude response from the security and data usage department.  The guy told me in so many words that if I do not like or agree with the policy that I should feel free to find another service provider.!!! I tried to explain that we watch Netflix and XFinity on-demand alot and I was told that that can not be anywhere close to the data usage. I checked my router and watching a "super HD, dolby 5.1" TV show on Netflix will average about 5-6 GB per hour (1.6MB/s) ... sp this means that I can only watch no more than 1-2 Super HD TV shows a day via Netflix before I run out of my data usage.    This seems a bit redicilous doesn't it? Maybe the TV ads about the higher speed than the competition should be accompanied with "as long as you don't use it too often"   Not a good experience ... 

  • Button, or other panel related question

    so, if any of you have read my previous topic about painting rectangles in a panel, that worked great, but now i need to mkae those rectangles components so that when someone hovers over it or clicks on it it displays information at a certain area. I know how to make listeners and how to add buttons in a panel, BUT how do I add buttons at a specific coordinate. This program graphs data on a specific scale and therefore adding a button in the approximate area using a grid layout will not be good enough. Is there anyway for me to place the the button/component/object at the extact location that I want?
    thanks in advance

    In future GUI related questions should be posted in the appropriate GUI forum (likely Swing).
    so, if any of you have read my previous topic about
    painting rectangles in a panel, that worked great,
    but now i need to mkae those rectangles components so
    that when someone hovers over it or clicks on it it
    displays information at a certain area. What?

  • How to send a list item value to URL to open data related to item value

    Hi,
    Iam using Apex4.0 and iam facing some problem. Iam unable to send selected list item value to the url specified in the HTMl region.
    Here i want to open the data related to list item value in other page.
    List item - :Familyp
    i want to pass this selected value to the url and when ever user selected the list item and clicks on the url, then it should display the item value related data in new page.
    I tried with &FamilyP in url but it's not working. Any one help me plz.
    Regards
    Vamsi.Tata

    Is it a normal Select list or Multi Select list?
    If you have select list that allows you to select multiple options then you cannot pass it through URL. Multi-select /Shuttle keep colon separated list in the item, and this confuses Apex because the Apex URL uses colons for a different purpose. No escaping or URL encoding will help.
    If it is normal select list that allows selection of only one option then you can pass through the url. Unless of course the data has a colon in it.
    For multi-select, and when the value contains colon, the only way is to save the value in session state, same page item or any other place like Application Item, and then reference it at the other end. Never pass through the URL.
    Regards,

  • Need to show data related to Process order request , BOM in a smart form

    Hi,
    I need to show data related to
    •     Process order request
    •     BoM
    Now in selection screen we are entering the followings.
    Manufacturing  Plant ,MRP Controller, Production scheduler, Order type , Order , Material, Sales order, WBS Element,Release,Scheduled start, Scheduled finish ,Selection profile.
    how to get 1> Process Order number,Produced Material,Material Description,Print date,Narcotics indicator , Quantity produced , Phase number , Phase description ,Resource description,Standard value  to show in a request form.
      2> Item category ,Component code,Component description , Component quantity ,Component Unit of measure ,BoM base quantity.
    Please help me how to get those values , what should be the aaproach , how to write the select quiry.
    Thanks

    Hi
    To get BOM details, do the following:
    1. Use the material number and goto Article to BOM link table (MAST) to get STLNR (BOM).
    2. With this STLNR, goto STPO table (where STLNR is the key field).  Here you will get all the BOM details like components (IDNRK), UoM (MEINS) etc....
    Hope this helps.
    THanks
    Vijay
    <b>PLZ REWARD POINTS IF HELPFUL</b>

  • Tables for sales & purchase order data relating to delivery

    hi all,
    i am writing a report to download all the delivery data after the delivery is created.i have to download the sales order data & purchase order data relating to this delivery also.
    i am using likp & lips table for delivery.which tables i
    should use to get the sales order data & PO data for the same delivery (likp-vbeln). i.e i need the sales & purchase order related tables which has link with delivery tables like likp & lips etc.
    plz advice me. it is very urgent.
    any idea is highly appreaciated.
    Regards
    pabitra

    in Addition to NM ,
    in case of STO there is no Sales Order , Process will be like this
    PO-->Delivery->PGI--->Billing  then u have to
    link
    *getting the History data of the PO
            select ebeln
                   ebelp
                   belnr
                   menge
                   from ekbe
                   into corresponding fields of table  w_ekbe
                   where ebeln eq w_lips-vgbel
                     and ebelp eq w_lips-vgpos
                     and bewtp eq 'L'.
    Regards
    Prabhu

  • Max date related to Max value in OBIEE answers

    Hi,
    I have one requirement in answers where in which i have to show the data with following columns
    My table structure is Account Number, date, Balance
    My report structure is Account Number, Max balance, Max balance Date, Balance as on start date, Balance as on end date.
    I have to provide a adhoc date filter, where in which user has the option to select the start date and end date.
    user wants the report in same format
    Can any one please let me know how to handle this in OBIEE 10.1.3.4 Answers.
    Thanks
    Krishna

    Hi Deva,
    But i tried with a simple scott RPD. It has two tables DEP and EMP. In the criteria section i dragged and dropped 4 columns. DEPNO, DNAME, ENAME AND SALARY. And in the criteria filter section, i added the column "DNAME" and chose the static filter as "ACCOUNTING". when i clicked on the results tab. It displayed the results related to DNAME-ACCOUNTING. After that, I created a dashboard_Prompt in which i chose the column prompt and the column as DNAME and the condition i gave is - equal to. In the Dashboard section, I dragged and dropped both the Dashboard_Prompt and Analysis. In the Dashboard, in Dashboard_Prompt section is chose the value "RESEARCH". Now the default analysis that was displaying the results related DNAME-ACCOUNTING changed and filtered the data related to DNAME-RESEARCH.
    By this experiment, I guess giving static value in criteria and changing it in the Dashboard_prompt will work. Is it right?
    Thanks
    Thenmozhi

  • [CS3] How to get the geometry data relative to the page?

    Hello!
    I have the inner geometry data (IGeometry) of a page item.
    There is a routine ::TransformInnerPointToPasteboard() which calculates the points relative to the origin of the pasteboard.
    But I want the geometry data relative to the page's origin, which is to top-left of the page
    Can anybody help me?
    Thanks,
    Alois Blaimer

    Hi Alois,<br /><br />I would make it like that..<br /><br />//just get page from an item (Splineitem, IGraphicframe...)<br />InterfacePtr<IGeometry> itemGeo ( mItemRef, UseDefaultIID() );<br />InterfacePtr<IHierarchy> itemHier ( mItemRef, UseDefaultIID() );<br />mPageRef = UIDRef( mDB, ::GetOwnerPageUID(itemHier) );<br /><br />//get position of item and page in pasteboard coordinates..     <br />PMRect fItemRect = inGetStrokeBounds ( mItemRef  );<br />PMRect fPageRect = inGetStrokeBounds ( mPageRef  );<br />          <br />//just calculate what you want<br />PMRect fRelItemRect;<br />fRelItemRect.Top()   = fItemRect.Top()  - fPageRect.Top();<br />fRelItemRect.Left()  = fItemRect.Left() - fPageRect.Left();<br /><br />PMRect inGetStrokeBound ( UIDRef& ref ) {<br />PMRect itemRect = Utils<Facade::IGeometryFacade>()->GetItemBounds( ref,Transform::PasteboardCoordinates(), Geometry::PathBounds());<br />return itemRect;<br />}<br /><br />Greetings<br /><br />Michael Bauder

  • In which Board we need to post cRIO related Questions?

    sir,
         In which board do i need to post cRIO related Questions and doubts regarding my application with cRIO .Please help me previously i have posted in  motion control drives as my application is related to motor control using cRIO.bu i am not getting any reply .i couldnt find any cRIO related board in select board option.
    Solved!
    Go to Solution.

    Hi illa,
    You can post your query under the Real Time Measurement and Control
    http://forums.ni.com/t5/Real-Time-Measurement-and/bd-p/280

  • How to upload company code data related to Company Code BP01?

    How to upload company code data related to Company Code BP01 FOR CIN?

    Hi,
    First check whether all the pre-requisites are completed.
    I'm assuming you have installed the Best Practices Baseline package (for country IN). If you have succeeded in actvating the buildig blocks (as per your scope) using Solution Builder, you would have populated all the company code data related to Co. code BP01. Looks like some steps are missing.
    Please refer to the OSS note 1408706 in this regard. From there, you also can refer to the "Quick Guide to Implementing the SAP Best Practices Baseline Package V1.604 (DE), which is self-explanatory. 
    Let me know if this helps.

  • Document Date & Posting date relations with PO-GRN-MIRO.

    Dear Experts,
    Could you please join the date relations for PO-GRN-MIRO with DOCUMENT DATE & POSTING DATE.
    I want to ask that what exactly we say Document Date & Posting Date to PO - GRN & MIRO.

    what exactly we say Document Date & Posting Date
    Just type in google difference between document date and posting date  and execute.  You will find lot of threads discussed on this topic.  Please dont post any query without searching the forum or google.
    G. Lakshmipathi

  • Two related questions:  ColdFusion 10/Java applications and J2EE supported servers

    I have two related questions:
    1.  CF10 and integration with Java Web applications
    We have a couple of Java applications running on JRun and interfacing with CF9 applications.  The JRun clusters were created through the JRun Admin and, apart from lack of Axis 2.0 support, have served us well for years now.  And, as would be the case, the ColdFusion9/Java/Flash application is a critical public-facing application that the business uses for bidding on projects.
    It appears that with ColdFusion 10 on Tomcat, we will not be able to run those Java applications on a Tomcat-CF10 JVM cluster.  Is this correct?  IF so, what are our options? 
    2.  J2EE Application Servers supported by Adobe for CF10
    Which of these is correct?
    A.  This URL (http://www.adobe.com/products/coldfusion-enterprise/faq.html) states "ColdFusion 10 supports IBM® WebSphere, Oracle® WebLogic, Adobe JRun, Apache Tomcat, and JBoss."
    B.  This URL (http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/coldfusion/pdfs/cf1 0/coldfusion10-support-matrix.pdf) states:
    "J2EE application servers: WebLogic Server 10.3, 11.1, WebSphere Application Server 7, ND 7 JBoss 5.1, 6.0, 7.1.0"
    I *think* "A" above is wrong re. support for Adobe JRun.  It does not specify a version of Apache Tomcat unless it is simply referring to the custom version the comes with CF10.
    Option "B" above shows no support of Adobe JRun or 'standard' Apache Tomcat.
    Thanks,
    Scott

    Question 1 above was answered:  "No support for Java web applications under CF10's custom version of Tomcat"
    Question 2:  No answer yet:  Is Apache Tomcat (NOT Adobe's customized version) supported for CF10 J2EE deployment?  I do not see any installation instructions on how to install CF10 on Apache Tomcat 6 or 7.
    Is anybody using Apache Tomcat as their J2EE app servers and, again, NOT Adobe's customized/limited version? 
    Thanks,
    Scott

Maybe you are looking for

  • How can I restore corrupted purchase download for my second Apple ID without 90-day ban

    Hello! The common thing leading to problems with Apple ID — I changed the country. I have a lot of software / music that I bought in AppStore/iTunes for my previous country, however recently my previous credit card was, say, gone, and I don't want to

  • Difference B/W Delivery plant  and item plant in Sales Order

    HI,       May i know Difference between  Delivery plant and item plant in Sales order and what is the use of those fields.What is the process of raising sales order for different plants. Thnks&Rgds NAG Edited by: NAGA SUDHIR on Apr 3, 2009 6:10 AM

  • Need Help with Advanced Button Actions

    I am a brand new Captivate 5 user and I have created a image button that I want to have a double action. When the user clicks on the image button, I want it to SHOW a new button AND SHOW another image. I used the Advanced Actions but it does not work

  • Cloning instance = /apex wants login

    Hi, I have cloned the default XE instance on the same machine using the following instructions: http://www.pgts.com.au/pgtsj/pgtsj0211b.html Right now I have a working second instance called XETEST. I can access it via the listener, via sqlnet on por

  • HT201077 icloud

    I cannot see my photos on icloud. My contacts are there. How do you see your pictures? Photo streaming on my phone is on and everything is backed up