Query problem with multiple date fields.

I need to select the greatest date from six different fields in each record and identify from which column was selected.
date01 date02 date03 date04 date05 date06
010190 010107 010190 010190 010190 010190
010190 010190 010105 010190 010190 010190
010103 010190 010190 010190 010190 010190
1)if greatest is in date01 then S = 1
2)if greatest is in date02 then S = 2
3)if greatest is in date03 then S = 3
4)if greatest is in date04 then S = 4
5)if greatest is in date05 then S = 5
6)if greatest is in date06 then S = 5
Do you have any idea on how to acomplish this?
Thanks

Another way (won't work for null dates):
with
the_data as
(select to_date('01011990','DDMMYYYY') col1,to_date('01012007','DDMMYYYY') col2,to_date('01011990','DDMMYYYY') col3,
        to_date('01011990','DDMMYYYY') col4,to_date('01011990','DDMMYYYY') col5,to_date('01011990','DDMMYYYY') col6
    from dual union all
select to_date('01011990','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012005','DDMMYYYY'),
        to_date('01011990','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012005','DDMMYYYY')
    from dual union all
select to_date('01012003','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012003','DDMMYYYY'),
        to_date('01011990','DDMMYYYY'),to_date('01012003','DDMMYYYY'),to_date('01011990','DDMMYYYY')
    from dual
the_setup as
(select rownum the_row,col1,col2,col3,col4,col5,col6,greatest(col1,col2,col3,col4,col5,col6) the_greatest,
        to_char(col1,'DDMMYYYY') || to_char(col2,'DDMMYYYY') || to_char(col3,'DDMMYYYY') ||
        to_char(col4,'DDMMYYYY') || to_char(col5,'DDMMYYYY') || to_char(col6,'DDMMYYYY') dates
   from the_data
the_columns as
(select the_row,
        max(decode(position,1,'1,')) || max(decode(position,2,'2,')) || max(decode(position,3,'3,')) ||
        max(decode(position,4,'4,')) || max(decode(position,5,'5,')) || max(decode(position,6,'6,')) the_cols
   from (select distinct the_row,level position
           from the_setup
          where substr(dates,8 * (level - 1) + 1,8) = the_greatest
         connect by level <= 6
group by the_row
select col1,col2,col3,col4,col5,col6,the_greatest,rtrim(the_cols,',') the_columns
  from the_setup s,the_columns c
where s.the_row = c.the_row
order by s.the_row
==========================================================================================================
COL1       | COL2       | COL3       | COL4       | COL5       | COL6       | THE_GREATEST | THE_COLUMNS
==========================================================================================================
01.01.1990 | 01.01.2007 | 01.01.1990 | 01.01.1990 | 01.01.1990 | 01.01.1990 | 01.01.2007   | 2
01.01.1990 | 01.01.1990 | 01.01.2005 | 01.01.1990 | 01.01.1990 | 01.01.2005 | 01.01.2005   | 3,6
01.01.2003 | 01.01.1990 | 01.01.2003 | 01.01.1990 | 01.01.2003 | 01.01.1990 | 01.01.2003   | 1,3,5Regards
Etbin

Similar Messages

  • Adhoc Query Requirement with Multiple Data Source

    Hi All,
    I have a Adhoc Query Requirement with Multiple Data Source. Is there any way to achive it. Other than Resultant set and bring into Model.
    Thanks
    SS

    You can compare stuff in the EL, but I don't think this is what you need.
    You can just use Java code in the backing bean class for all the business logic. You can use DAO classes for database access logic. Finally for displaying you can use the JSF tags such as h:outputText.

  • Is anyone else having problems with Apertures Date fields?

    After experiencing a sysems failure I began restoring my images from backups.  I have had no end of problems with Image dates.  I have come to the determination that Aperture is NOT using either the "Create Date" or "DateTimeOriginal" as the image "Date" or "Date Created" data if other fields have other dates.
    Here is a clip from my image metadata using exiftool:
    File Modification Date/Time     : 2012:09:23 19:53:15-04:00
    File Access Date/Time           : 2013:01:16 11:34:38-05:00
    File Inode Change Date/Time     : 2013:01:16 11:31:32-05:00
    Create Date                          : 2006:02:20 11:51:12.10
    Date/Time Original              : 2006:02:20 16:51:12.10
    Modify Date                          : 2006:02:20 11:51:12.10
    And here is what Aperture utilized on import
    Date:                               9/23/12 7:53:15 PM EDT
    Date Created                         9/23/2012 7:53:15 PM
    So Aperture utlized the File Modification Date/Time as the Create Date despite that the fact that the Create Date field is present and is properly formatted in the original image.
    According to the Aperture mapping table, this shouldn't be happening.
    Now, before someone recommends that I use Aperture's Date Adjust utility - I'm talking about  slightly over 30,000 images.  Editing images one at a time, or in blocks when you don't know what field Aperture is using as the Create Date would require individual inspection of each image followed by manual adjustment of each image.  That approach isn't acceptable.

    Hmm ok, let me restate the issue then, I thought I was clear.  I could have pointed out in my original post however, that only the EXIF and IPTC date fields were displayed from the metadata dump.
    The data set presented in my first post is the EXIF dataset from the file which clearly shows the image was captured by digital camera at
    Create Date                          : 2006:02:20 11:51:12.10
    Date/Time Original              : 2006:02:20 16:51:12.10
    (The delta of 5 hours is the result of Zulu versus local time offset)
    But, when I ingested it into Aperture, the import routine utilized the IPTC field
    File Modification Date/Time     : 2012:09:23 19:53:15-04:00
    which is updated by the OS whenever you move the file around outside of Aperture. (a number of image data fields are updated by the OS - filename for example is another.).  This resulted in the image date fields being stamped in Aperture as:
    Date:                               9/23/12 7:53:15 PM EDT
    Date Created                         9/23/2012 7:53:15 PM
    Which obviously came form the File Modification Date/Time field and not (either) the Create Date or Date/Time Original fields.

  • How to create a group with multiple data fields

    Post Author: RichS
    CA Forum: Formula
    Using CR XI.  Using CSV input from ODBC text driver.  No problems here.
    There are 3 fields that I want the same group by action.  Is this possible?) 
    If any one of these 3 fields change I want some header information and column fieldnames to display.  The header information I only want displayed on the first page (on the change) and the column fieldnames to display on every page.  I have played around with things like "InRepeatedGroupHeader" and "report group header on each page".  I am not getting all the results that I am looking for though.
    I want report to look like:
    Page header stuff  (to display on every page)  This data consists of some fields that will have static data and will display on every page.  And it consists of 3 non-static fields that I want to group on. 
    Group header stuff that I only want displayed on the first page on a change from one of the 3 fields mentioned above.
    Column headings that I want displayed on every page.
    Details data
    Group footer stuff (details not important for this)
    I get the expected output (column headings displayed on every page, and group header stuff display on the first page on each group change) with one group field.  But I want the group change to happen for all 3 fields.
    It seems simple but I can't find a way to create a "group" so if "field1 or field2 or field3" change, I get the same "group by" action.  I just need to know how to get the expected action.
    I expect that I might have some terms mixed up and/or some important information that would aide you in helping me.  If that is the case please re-post and I will add any missing or mis-stated information.
    Thanks,

    Post Author: V361
    CA Forum: Formula
    I am slightly confused, but perhaps you can create a formula
    Then group on the formula.  If this is not what you want, could you post some sample data, with the desired results.

  • Ejb datacontrol, query panel with timestamps / date field errors

    Hi,
    I made an ejb datacontrol on a session bean in jdev 11g ps1 and used the named criteria of this entity in the data control to create an af querypanel. This works well.
    first thing I cannot configure a date picker with time on this timestamp field (only date ).( does not matter what I configure in the entity datacontrol xml , it does not work )
    and displaying the timestamp field in a inputData ( result table ) and showing the time also does not work either.
    When I use in the query panel a between query operator on this date or timestamp field I get this error.
    Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1241)
    <BeanDataCollection><invokeMethod> Exception occurred invoking $Proxy179.queryByRange
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.adapter.bean.provider.BeanDataCollection.invokeMethod(BeanDataCollection.java:405)
         at oracle.adf.model.adapter.bean.jpa.JPQLBeanDataCollection.getRecordCount(JPQLBeanDataCollection.java:164)
         at oracle.adf.model.adapter.bean.provider.BeanDataCollection.init(BeanDataCollection.java:153)
         at oracle.adf.model.adapter.bean.jpa.JPQLBeanDataCollection.init(JPQLBeanDataCollection.java:110)
         at oracle.adf.model.adapter.bean.provider.BeanDataCollection.refresh(BeanDataCollection.java:380)
         at oracle.adf.model.adapter.bean.provider.BeanDataProvider.getDataProvider(BeanDataProvider.java:63)
         at oracle.adf.model.adapter.bean.DataFilterHandler.invokeAccessor(DataFilterHandler.java:137)
         at oracle.adf.model.adapter.bean.BeanFilterableDataControl.invokeAccessor(BeanFilterableDataControl.java:78)
         at oracle.adf.model.bean.DCBeanDataControl.invokeAccessor(DCBeanDataControl.java:447)
         at oracle.adf.model.bean.DCDataVO$DCAccessorCollectionAdapter.getDataProvider(DCDataVO.java:2627)
         at oracle.adf.model.bean.DCDataVO$DCAccessorCollectionAdapter.refreshIterator(DCDataVO.java:2519)
         at oracle.adf.model.bean.DCDataVO.executeQueryForCollection(DCDataVO.java:419)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1130)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1299)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1217)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1211)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:6097)
         at oracle.adf.model.bean.DCBeanDataControl.executeIteratorBinding(DCBeanDataControl.java:943)
         at oracle.adf.model.binding.DCIteratorBinding.doExecuteQuery(DCIteratorBinding.java:2147)
         at oracle.jbo.uicli.binding.MyIteratorBinding.executeQuery(JUAccessorIteratorDef.java:717)
         at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.applyAndExecuteViewCriteria(JUSearchBindingCustomizer.java:598)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:424)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1289)
         at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.ejb.EJBException: EJB Exception: ; nested exception is:
         java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82); nested exception is: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:109)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:91)
         at $Proxy179.queryByRange(Unknown Source)
         ... 65 more
    Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1241)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:93)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
         at $Proxy175.createQuery(Unknown Source)
         at nl.tennet.mhs.console.model.services.MhsConsoleBean.queryByRange(MhsConsoleBean.java:32)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy181.queryByRange(Unknown Source)
         at nl.tennet.mhs.console.model.services.MhsConsole_ssug8i_MhsConsoleImpl.queryByRange(MhsConsole_ssug8i_MhsConsoleImpl.java:218)
         at nl.tennet.mhs.console.model.services.MhsConsole_ssug8i_MhsConsoleImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at nl.tennet.mhs.console.model.services.MhsConsole_ssug8i_MhsConsoleImpl_1032_WLStub.queryByRange(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
         ... 66 more

    what happens if you do the following on all three different environments:
    SQL> select to_char(exp_date, 'dd-mon-yyyy hh24:mi:ss') from your_table where your_condition ;
    [pre]

  • Problem with displaying Date field in the table.

    Hi All,
    I am trying to display data into a table UI Element. 
    In that data, i have one DATE type field. While displaying data in DATE field, it will display like this "01.02.2009".
    Now my requirement is if i want to modify that DATE field, it will allow to modify "01.02.2009"  to "26.02.2009".
    But while modifying DATE field , I want to show the Calender of that month, in that i  have to select the another date.
    (Like normal Date UI Element will show that calender).
    Can anyone please help me.
    Thanks in Advance!
    Regards,
    Sreelakshmi.

    Hi,
          Go to the context attribute that was mapped to the DATE field of the table and change the perperty INPUT HELP MODE to  AUTOMATIC and it works.
    Regards,
    Manne.

  • Problem with the date field in Table Control

    I have created a table control in my module programming. One of the column in the table control is a date field which is I/O field.
    Now if I enter a value in date field column and hit enter the date field is reset. I dont want the field to get reset and accept valid date field.
    I have set type of the column as DATS and I havent used any dictionary fields. The column is from the internal table in the program.
    Please suggest

    In your PAI, in the LOOP AT <itab> did you
    - check date validity
    - update internal table
    * Sample
    LOOP AT itab.
      FIELD itab-field MODULE checkfield.
      MODULE updateitab.
    ENDLOOP.
    Look also at SAP documentation like [Table Controls|http://help.sap.com/abapdocu/en/ABENTABLE_CONTROL1_ABEXA.htm] or [Table Controls in ABAP Programs|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm]
    Regards,
    Raymond

  • Problem with the "date" field

    Which is the correct way to insert a date in the attribute specified with a "date" type of a table? For example: 02-03-1999, 02-mar-1999, 02/03/1999......or what else?
    Thank you.
    Marco

    Hi,
    Date can be in ay formats you had mentioned.
    You can use to_date or to_char functions to
    manipulate the date in the way you wanted.
    Regards
    Anand

  • Problem with multiple 'selectOneMenu' fields

    I have a JSF web page with 2 selectOneMenu fields. The first field is populated as the page loads,
    the second field is populated from the value selected in the first field. The second field value is
    associated to a variable in the backing bean which is used for further processing when the
    command button is pressed.
    on pressing the command button the following error message appears :
    jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[sourceId=form1:menu2,summary=Validation Error: Value is not valid)
    Below is my JSF page and backing bean. Any help would be appreciated
    <h:form styleClass="form" id="form1">
         <BR>
         <h:selectOneMenu styleClass="selectOneMenu" id="menu1" valueChangeListener="#{empDetailsBackingBean.EmpSelectDetails}" onchange="submit()">
         <f:selectItems value="#{empDetailsBackingBean.selectItems}"/>
         </h:selectOneMenu>
         <BR>
         <h:selectOneMenu styleClass="selectOneMenu" id="menu2" value="#{empDetailsBackingBean.keyDetails}">
         <f:selectItems value="#{empDetailsBackingBean.selectItems1}"/>
         </h:selectOneMenu>
         <BR>
         <hx:commandExButton type="submit" value="Submit" styleClass="commandExButton" id="button1" action="#{empDetailsBackingBean.EmpDetails}">
         </hx:commandExButton>
    </h:form>
    public class EmpDetailsBackingBean
         private String c12 = "";
         private String c4 = "";
         private String empNo = "";
         private String title = "";
         private String name = "";
         private String add1 = "";
         private String add2 = "";
         private String add3 = "";
         private String postCode = "";
         private String keyDetails = "";
         private List selectItems;
         private List selectItems1;
         private HoldDetails details;
         public EmpDetailsBackingBean()
              C4Utility util = new C4Utility();
              selectItems = util.getDetails();
              EmployeeUtility util1 = new EmployeeUtility();
              selectItems1 = util1.getDetails("", "Y");
         public void EmpSelectDetails(ValueChangeEvent vce)
              c4 = (String) vce.getNewValue();
              EmployeeUtility util = new EmployeeUtility();
              selectItems1 = util.getDetails(c4, "Y");
         public String EmpDetails()
              c12 = keyDetails.substring(0,6);
              empNo = keyDetails.substring(6,12);
              EmpDetails util = new EmpDetails();
              details = util.getEmpVals(c12, empNo);
              c12= details.getC12();
              empNo = details.getEmpNo();
              title = details.getTitle();
              name = details.getName();
              add1 = details.getAdd1();
              add2 = details.getAdd2();
              add3 = details.getAdd3();
              postCode = details.getPostCode();
              return"";
         public String getAdd1()
              return add1;
         public void setAdd1(String add1)
              this.add1 = add1;
         public String getAdd2()
              return add2;
         public void setAdd2(String add2)
              this.add2 = add2;
         public String getAdd3() {
              return add3;
         public void setAdd3(String add3)
              this.add3 = add3;
         public String getC12()
              return c12;
         public void setC12(String c12)
              this.c12 = c12;
         public String getEmpNo()
              return empNo;
         public void setEmpNo(String empNo)
              this.empNo = empNo;
         public String getName()
              return name;
         public void setName(String name)
              this.name = name;
         public String getPostCode()
              return postCode;
         public void setPostCode(String postCode)
              this.postCode = postCode;
         public String getTitle()
              return title;
         public void setTitle(String title)
              this.title = title;
         public HoldDetails getDetails() {
              return details;
         public void setDetails(HoldDetails details) {
              this.details = details;
         public String getKeyDetails() {
              return keyDetails;
         public void setKeyDetails(String keyDetails) {
              this.keyDetails = keyDetails;
         public List getSelectItems() {
              return selectItems;
         public void setSelectItems(List selectItems) {
              this.selectItems = selectItems;
         public List getSelectItems1() {
              return selectItems1;
         public void setSelectItems1(List selectItems1) {
              this.selectItems1 = selectItems1;
         public String getC4() {
              return c4;
         public void setC4(String c4) {
              this.c4 = c4;
    }

    I haven't taken the time to read your code, but the error message "Value is not valid" mostly means that the value of f:selectItems is dirty.
    If you understand generics, this one clearly explains the usage of h:selectOneMenu:
    JSF<h:selectOneMenu value="#{myBean.selectedItem}">
        <f:selectItems value="#{myBean.selectItems}" />
    </h:selectOneMenu>MyBeanprivate T selectedItem;
    private List < SelectItem < T, String > > selectItems;
    // + getters + setters
    // T is the Object you want to select. String is the label for the menu.
    // think away the spaces surrounding < and >, the parser of this forum is a bit crappy ;)

  • Problem with the Date Field in Production

    In Development while using a variable with data element DATS , the variable gets initialised to 00000000.
    But the same does not get initialised in Production.....
    Kindly  suggest?
    Regards
    Dilip

    please see the link ...in this the   datefields also included in the table control  of the 
    Screen  program  ....  how the  fields are  populated in the table  using wizard ..
    <a href="http://">http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm</a>
    reward points if it is usefull ....
    Girish

  • Problem with Multiple Data Source Retrieval

    Hi,
    We are working on a Project that is concerned with JSF and XML parsing. We have successfully parsed the XML and made an object model- Lists out of it to display it using JSF. Additionaly we also want to display some data from the database compare it with the XML data and then display it on the GUI.
    So e.g we have an attribute code in the XML structure which is a number. Before displaying it on the GUI we first have to query the database what this number or code actually means i.e its description text . get it and display alongside the other data from the XML. So the question is
    1) How to get data from different data sources
    2) Compare the data
    3) and merge and display into GUI .
    And we have to display it with JSF and as far as i know JSF has no comparison mechanism ..??!!
    Thanks for any help,

    You can compare stuff in the EL, but I don't think this is what you need.
    You can just use Java code in the backing bean class for all the business logic. You can use DAO classes for database access logic. Finally for displaying you can use the JSF tags such as h:outputText.

  • Problem with current date field...

    I want to display the current date and time, but when I change the data format in the binding tab to "Date and Time" and assign a pattern that includes date and time, all I get is the current date, NOT the time. TIA!

    I have tried applying these scripts in the initialize event to all manner of objects, text field objects, date/time objects, numeric objects, current date objects, and it shows nothing. If I could just edit the date/time format of the current date object when it is set to "Runtime Property-Current Date/Time" I MIGHT be able to use it. I really appreciate your help thus far. Would it be possible for you to share a pdf file that you've made where this works so I might disect it? No matter what pattern I specify in the "Field" palette, it shows it's own formatting.
    UPDATE: I did go back after trying it a few times to change the value after Page1 to match the name of my field.
    UPDATE 2: Here is a link to what I've done. Take a look and let me know what I'm doing wrong, or change it and share it back. Thanks so much for your help!!!
    https://www.dropbox.com/s/1so2hcao372k37z/Script%20Examples.pdf
    Vipin Bhargava wrote:
    I have found 3 more variants. You can write below code on initialize event. It will automatically display the current data & time during the preview
    1.   xfa.form.form1.Page1.TextField1.rawValue
    = util.printd("dd.mm.yyyy HH:MM", new Date()); 
    2.  xfa.form.form1.Page1.TextField2.rawValue = util.printd("dddd d. mmmm yyyy HH:MM ", new Date());
    3.  xfa.form.form1.Page1.TextField3.rawValue = util.printd("date{EEEE, D. MMMM YYYY} time(de){HH:MM:SS Z}", new Date(), true);
    Hope this helps,
    Vipin

  • Facing problem with a date column in select query

    Hi,
    I am facing problem with a date column. Below is my query and its fainling with " invalid number format model" .
    Query: SELECT *
    FROM EMP
    WHERE trunc(LAST_UPDATED) >= to_date(to_char(22-05-2009,'dd-mm-yyyy'),'dd-mm-yyyy')
    LAST_UPDATED column is "DATE" data type.
    Please help me Thanks

    Radhakrishna Sarma wrote:
    SeánMacGC wrote:
    WHERE LAST_UPDATED >= to_date('22-05-2009','dd-mm-yyyy');
    You do not need the TRUNC here in any case.
    I don't think so. What if the user wants only data for 22nd May and the table has records with date later than 22nd also? In that case your query willl not work. In order for the Index to work, I think the query can be written like this I think Sean is right though. Use of TRUNC Function is quiet useless based on the condition given here, since the to_date Function used by OP will always point to midnight of the specified date, in this case 22-05-2009 00:00:00.
    Regards,
    Jo
    Edit: I think Sean proved his point... ;)

  • Multiple Date Fields (Fact Table) - Linking with Time Dimension

    I have a fact table that has multiple date columns.
    I can make a time dimension, but it has to be joined to a particular date column. This becomes difficult because of the limit in having multiple date fields reference one time dimension. I can see possibly
    creating a date table which contains all dates, link to fact as well as time dimension table. I am trying to better visualize the table layout on this one. Or are there possibily better ways of looking at this senerio
    Any idea's

    Figured this one out; going to use one time dimension - what looking too much into the details in regard to this scenerio

  • Problem with multiple Toplink/JPA apps in same server

    Anyone have experence of running serveral Toplink/ EJB-3 Web apps in the same server (OC4J, alas)?
    We seem to get a problem with the second app failing to initialise toplink, with an entity not found message. Each app runs OK on it's own.

    Yes, they access the same datasource and most of the tables overlap.
    We're thinking it might help to have common entity classes and put them in a shared library, but I don't know if this is relevant (setting up shared libraries complicates testing and tends to snowball, I reckon we need about 15 jars all told).
    I''ve had some funnies on OC4J before which I think may be to do with it's use of ClassLoaders, for example I initially put persistence.xml in the libary jar with the data model, but for some reason I get the entity not found error that way. It only seems to work if it's in the classes folder.
    For the moment we're getting arround the problem with multiple OC4J instances in the server.

Maybe you are looking for