Compare two dates in page validation

APEX 3.0.1, RDBMS 10GR2
I am new to APEX.
In my region, I have several items, two of which are start date and final date generated from a date picker (calendar). I would like to build a simple validation that insures that the start date is not greater than the final date.
I created a page validation (type = SQL expression), with validation expression 1 as:
to_date(P21_SUBD_START_DATE_DATE,'DD-MM-YYYY') >
to_date(P21_SUBD_FINAL_DATE,'DD-MM-YYYY')
and the system returns the following error message:
ORA-06503: PL/SQL: Function returned without value
ERR-1023 Unable perform validations.
Any ideas on how I can enforce validation that insures that the start date is not greater than the final date or insight into this error is appreciated.
Thanks in advance.
Barry D.

Figured it out. In case anyone else runs into this problem I used:
Type = PL/SQL Expression, with Validation Expression 1 as:
to_date(:P21_SUBD_PERL_DATE,'MM/DD/YYYY') < to_date(:P21_SUBD_FINAL_DATE,'MM/DD/YYYY')
Barry D.

Similar Messages

  • Comparing two dates+times [bash]

    To compare two dates+times* in bash I have always used date +%s and compared the resulting strings.  Is there a better way to do it?  Thanks.
    * As in "is date+time Y after date+time X?"

    Years ago I wrote a bash script to build a thumbnail gallery webpage for a local directory structure of torrents.  For each torrent, it created the thumbnail of an image with the same name, scraped torrents to get seeders/leechers, parsed a text file of urls and added links below the image with special favicons for commonly linked sites.
    That was a hassle, and I have been afraid to look at the script since I stopped using it.  But the page it produced was pretty sweet.
    Most of the scripts I write are a bit more down-to-earth than that though.
    Last edited by alphaniner (2012-04-25 18:50:02)

  • Compare two dates in a report

    Hi,
    I would like to compare two dates on a report.
    I would like to compare the opportunity created date and the opportunity modified date. I can't use this formula CASE WHEN Opportunity."Last Modified" = Opportunity."Created Date" then 1 else 0
    I think I have to use TIMESTAMPDIFF but I don't know which interval I have to put to analyze the entire date in this format 31/12/1999 16:49:08
    Thanks a lot for your help
    Regards,

    Hi !
    It depends on the interval you need to compare these dates. If you want to know the number of days between these dates, you'll have to use SQL_TSI_DAY as interval. If it's minutes, you'll need SQL_TSI_MINUTE...
    Here are the possible intervals :
    *SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, or
    SQL_TSI_YEAR*
    Hope this will help, feel free to ask more !
    Max

  • Compare two dates in different format.

    Hi
    I want to compare two dates....one of which is in the timeStamp format ("yyyy-MM-dd HH:mm:ss")
    and the other is in java.util.Date i.e Tue Oct 11 10:22:47 GMT+05:30 2005
    Do I have to tokenise and then compare them.Is there any better approach?
    I want to find out which is greater/smaller one.
    Pls help.
    Regards,
    Sandip.

    I would convert both to Date and compare them. To convert String to Date check java.text.SimpleDateFormat and its parse(...) method.
    HTH
    Mike

  • How to Compare two Dates in java

    How to Compare two Date Field after getting the values from jTextField1.getText() and jTextField2.getText().

    Date d1=DateFormat.getDateInstance().parse(yourstring1);
    same for d2
    d1.compareTo(d2);
    could be that i misrememberd the exact naems of some functions or mixed up something in the equence of d1=

  • Comparing two data records of same IDOC

    Hi,
    In PI, we need to compare two data records of same IDOC to figure out if what type change occurred.  For example, BENFIT3 IDOC contains data records tilted "E1BEN04".  When there are multiple "E1BEN04" data records, then we need to compare the data inside them to see whether name, or data of birth or SSN is changed. 
    Has anybody came across this before. Your help is much appreciated.
    Thanks
    -Teja

    If it is very few fields then you could use graphical mapping to determine the changes.

  • Comparing two dates and adding days to date

    Hi,
    I want to compare two dates(like 2006/10/21 and 2006/11/2),how can i compare these two dates,like which is greater.And if to the second date,i want to add some number of days like 10 days,how can i add so that the date becomes 2006/11/12).
    Please reply soon.Thanks

    No,all other queries are different,as they have the
    date in this format
    '2006-03-06 " but i have the date in this format
    "2006-03-06 10:26:46.0",
    i.e the time is also assciated with it.
    If I have only the date(in string format or date
    date format 2000/12/1),then I can easily do it,but
    I have the time also.If I have the date only,then I
    can split the date into three strings,and after
    converting into integer I can pass it to the
    constructor,but what about the time?SimpleDateFormat can parse "2006-03-06 10:26:46.0" date too:
               SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SS");
               Date date = dateFormat.parse("2006-03-06 10:26:46.0");
               System.out.println("date = "  +date);

  • Compare Two Date - Very Urgent

    hi to all,
    i want to compare two date..
    i m getting one date from database and having current date..
    what my issue is i want to dispaly error message when database date greater
    than current date value..
    pls help to my problem...

    import java.util.*;
    public class DateVlid {
         public static void main(String[] args)throws ParseException {
              Calendar currentDate=Calendar.getInstance();
              Calendar dbDate=Calendar.getInstance();
              dbDate.set(2007,12,10);
              boolean b=currentDate.before(dbDate);
              if(b){
                   System.out.println("it is before date");
    }Try it once for a while.
    If it has any problems let me know.

  • Java 1.3 comparing two dates using Calendar.before(Calendar)

    Has anyone used the Calendar.before() method for comparing two dates, how accurate is this?
    Some users have found problem with this method, is this true?

    manjit84 wrote:
    Has anyone used the Calendar.before() method for comparing two dates, Yes.
    how accurate is this?I've never noticed a problem.
    Some users have found problem with this method, is this true?Check the bug database^1^?
    ^1^ http://bugs.sun.com/

  • How to compare two dates that should not exceed morethan 3 years

    hi all,
    can you please tell me how to compare two dates( basically dates are string type)
    that should not exceed more than 3 years? in JAVASCRIPT
    Thanks in Advance.

    This is not a JavaScript forum.
    [*Google* JavaScript Forum|http://www.google.co.uk/search?q=JavaScript+Forum&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a]
    Good luck.

  • How to compare two dates to know which one is greater than oher?

    how to compare two dates to know which one is greater than oher?
    Please search before asking basic questions.
    Edited by: Rob Burbank on Mar 27, 2009 9:26 AM

    Hi,
    If thse to date fields are of same type u can directly compare like this.
    regards,
    Bharat.

  • Compare two dates with NULL in one

    I am trying to do the following with a simple SQL. Compare two dates and get the latest one, but the greatest() function always returns NULL if NULL is present. So how can I do it ?
    Date1 Date2 Desired Result
    Null 01-Dec-09 01-Dec-09
    01-May-09 01-Mar-09 01-May-09
    01-May-09 NULL 01-May-09
    01-May-09 01-Nov-09 01-Nov-09
    NULL NULL NULL
    Any suggestion ? Thanks

    Hi,
    Try this,
    create table test1
    fdate date,
    tdate date
    insert into test1 values (null,'25-jan-2010');
    select greatest(nvl(fdate,tdate),nvl(tdate,fdate)) greatest from test1;
    Thanks&Regards,
    Jai

  • Comparing two dates in a report

    Hello,
    I am attempting to compare two dates in a report in order to format a column. My code for that portion of the report is as follows:
    CASE
       WHEN TO_DATE(DATE_DUE,'DD-MON-YYYY') -
            TO_DATE(sysdate,'DD-MON-YYYY') <= 5 THEN
              '<span class="due">'||DATE_DUE||'</span>'
       ELSE
          DATE_DUE
    END AS DATE_DUE,I'm getting the error message ORA-00932: inconsistent datatypes: expected CHAR got DATE.
    I've been trying to fix the condition to get rid of the error with no success.
    Thanks
    -Brian

    One thing I just noticed that may or may not be the problem is that your case statement is returning two different datatypes depending on the condition. In one part, it is returning a character string of the span tags concatenated with the due_date (which in and of itself are incompatible datatypes) and the second part is returning just a date.
    Again, not sure if the SQL engine will do automatic conversions for you, but this seems to jive with your "char vs. date" error.

  • How to compare two dates

    Hi,
    I have two colums(start date &end date) of data type date in my page and both are optional ones.
    I need to have a validation on those date columns,
    End date should not be greater than Start Date.
    This validation should be triggered once i click on Apply button.
    Pseudo Code:
    If (endate>startdate)
    raise form_trigger_failure;
    Can anyone suggest how/where to implement the code, if possible please provide the sample code.
    Thanks,
    Mahesh

    sorry, I was thinking java and not oaf
    there is similar thing thats done in tutorials exercise create page part2
    this is the code snippet from jdev guide...but you may want to go through the chapter before you put this code in your EO file.
    Step 10.2 Add a validateEndDate() method Add the following new method to your EmployeeEOImpl class. /*
    * Verifies that the employee's End Date is valid.
    * Business Rules:
    * This is an optional value which can be updated at any time.
    * Cannot be earlier than sysdate.
    protected void validateEndDate(Date value)
    // If a value has been set, validate it.
    if (value != null)
    OADBTransaction transaction = getOADBTransaction();
    // Note that we want to truncate these values to allow for the possibility
    // that we're trying to set them to be the same day. Calling // dateValue( ) does not include time. Were we to want the time element,
    // we would call timestampValue(). Finally, you cannot compare
    // oracle.jbo.domain.Date objects directly. Instead, convert the value to
    // a long as shown.
    long sysdate = transaction.getCurrentDBDate().dateValue().getTime();
    long endDate = value.dateValue().getTime();
    if (endDate < sysdate)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "EndDate", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_END_DATE_PAST"); // Message name
    } // end validateEndDate()

  • Compare two Dates

    I am familiar with Spry validation widgets but not exactly an
    advanced user. Is the following possible?
    I have two date fields on a form which specify a date range
    (dateFrom & dateTo). Is there a way to validate them to ensure
    that dateTo > dateFrom?
    I also need to use the date format: dd/mm/yyyy.
    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by J:
    I have user to input a date. How can I compare user's input with sysdate(today's date)? I tried GREATEST function, moths_between(...). both not acceptable. Please advise.
    Thank you!<HR></BLOCKQUOTE>
    take user input in a variable and compare with sysdate,
    ex
    sysdate=&date or convert date into user input format
    null

Maybe you are looking for

  • I just got a New Mac pro--wanted to partition..DVD install disc says error.

    I just got the new mac out of the box...Partitioned it and installed software. DVD 1 worked good..when it asked for dvd 2...it says error. I cleaned the DVD and tried it again. Same problem. I put it in my power mac to see if it would read it..and it

  • Removing quotation marks from channel names

    Firstly - I am new to both DIAdem and VB so please forgive my ignorance! I have a large data set containg many groups with (almost) identical channel names in each group. For reasons not worth going into some of the channel names have quoation marks

  • N97 Cant connect to Windows 7 64bit - N97 doest se...

    Heey people, I Got an new N97 but i didnt got any micro usb cable. Then i got to the vodafone store and bought an universal micro usb-usb cable. Installed pc suite on my windows 7 64bit.  tried to connect the nokia n97 but it cant..  My phone just sa

  • I have problem with my G510

    I dont have is this my place to ask but... I use windows 8.1 on my G510 and when i instaling the drivers for Hotkeys(fn keys) i reciave this message: This program does not support this system... 

  • Unable to install latest itunes

    Hi, I use windows xp, i had old itunes and ipod manager/updater. I unstalled all the old ipod and itunes and also quick time player. i cleaned up the registry using Microsoft fixit. Still no luck :-( latest iTunes doesn't install. There seems to be i