Restricting a Date field in a calculated KF

<u>Objective</u>
The difference between two dates: current date - date1
<u>Issue</u>
date1 value is 00/00/0000 for certain records and the date difference calculation is not accurate.
<u>Question</u>
How can I restrict the calculation for records that contain a zero value for date1?
Thanks,
Dave

Just include the condition (date 1<> 0) * (curr date -date 1) in the formula you trying to calculate the date difference.

Similar Messages

  • Date field navigator controll problem

    Hi Friends,
    Recently i have implemented the one view with the DATE field as a input field, The date field data type is sy-datum.
    When i click the date field F4 help, the new pop up will be triggered and shows the date calander. the funcitonality is correct.
    Now my use want's restrict the date field navagator with in given period only, For example the date field low value is 01/01/2010 and high value is  31/12/2010, The user want's to see the date field calander betweeen 01/01/2010 and 31/12/2010, user do not want to see the other dates.
    Can you please help about the issues. the solution is more helpful for me , if possible please provide the solution.
    Thanks & Regards
    charan

    I noticed the same behaviour. As it turns out, it IS a JHeadstart problem that causes this error to happen. When I generate a UIX paga with both an Advanced Search region and a Quick Search region, this error only happens in the Quick Search region. The Advanced Search region works fine.
    Using the FireBug extension for Firefox I noticed this difference between Advanced Search and Quick Search: Advanced Search passes on a reference to the input element into the reference variable and no error is thrown. Quick Search passes on an array of input elements and since an array doesn;t know of the select() method, an error is thrown.
    I will create a worksround for this issue by modifying the ADF JavaScript library since I now know where this error happens. Please review this situation and try and solve this.
    Thanks a lot in advance,
    Wouter van Reeven
    AMIS

  • Date field difference calculation

    Hi all,
    I am new to Adobe and Java scripting so apologies if this has already been answered elsewhere - I have not been able to find it if it has.
    I want to calculate the difference between two dates fields in hours and mins on a form.
    I have two fields, both Date format (dd/mm/yyy HH:MM), a Start and End date and I want the difference between them in the Time format HH:MM.
    Can anyone help me with the script for this? What I have so far is:
    var strStart = this.getField("StartTime").value;
    var strEnd = this.getField("EndTime").value;
    if(strStart.length || strEnd.length)
    var dateStart = util.scand("dd/mm/yyyy HH:MM",strStart);
    var dateEnd = util.scand("dd/mm/yyyy HH:MM",strEnd);
    var diff = dateEnd.getTime() - dateStart.getTime();
    // One Day = (24 hours) x (60 minutes/hour) x
    // (60 seconds/minute) x (1000 milliseconds/second)
    var oneMin = 60 * 60 * 1000;
    var mins = Math.floor(diff/oneMin);
    event.value = util.printd("HH:MM",mins);
    But this is not working...
    Mary

    The result can be formatted using:
    // format result using "h:MM" format
    event.value = util.printf("%,0 0.0f" + ":" + "%,002.0f", nHours, nMinutes);
    One cannot use the date or time formats since the time values will be limited to the hours and minutes values for 1 day, so any time value that is over 23 hours 59 minutes is not possible.
    A full script solution including document level functions for conversion of date strings to minutes and converting minutes to a time string:
    // reusable document level functions;
    function Time2Num(cFormat, cDate) {
    // convert date value with format to number of minutes form Epoch date;
    var oDate = util.scand(cFormat, cDate);
    var nMins =  null;
    if(oDate ==  null) app.alert("Error converting " + cString + " using " + cForamt);
    else nMins = oDate.getTime() / (1000 * 60);
    return Math.floor(nMins);
    } // end Time2Num format
    function Num2Time(cFormat, nMins) {
    // convert number of muniutes to h:MM or HH:MM format;
    // return formatted string for valid formats;
    // return null for invalid formats;
    var cElapsed = null;
    // test for nMins being a number;
    if(isNaN(nMins)) {
    app.alert("Minutes must be number",0, 0);
    } else {
    var nHours = Math.floor(nMins / 60);
    var nMinutes = Math.floor(nMins % 60);
    switch(cFormat) {
    case "h:MM":
    cElapsed = util.printf("%,0 0.0f" + ":" + "%,002.0f", nHours, nMinutes);
    break;
    case "HH:MM":
    cElapsed = util.printf("%,002.0f" + ":" + "%,002.0f", nHours, nMinutes);
    break;
    default:
    app.alert("Invalid format " + cFormat + "\nMust be \"HH:MM\" or \"h:MM", 0, 0);
    break;
    return cElapsed;
    } // end Num2Time function
    // end document level funcitons;
    // custom calculation script;
    event.value = ''; // clear result;
    var strStart = this.getField("StartTime").value;
    var strEnd = this.getField("EndTime").value;
    if(strStart.length || strEnd.length) {
    var nDateStart = Time2Num("dd/mm/yyyy HH:MM",strStart);
    var nDateEnd = Time2Num("dd/mm/yyyy HH:MM",strEnd);
    var nMins = nDateEnd - nDateStart;
    // format result using "h:MM" format
    event.value = Num2Time("h:MM", nMins);
    // end custom calculation script;

  • Restrict date field in vf01 to system date .

    hi gurus,
    my requirement is to restrict date field in vf01 to system date .
    i have changed the 011 routine in vtfa .
    do I need any extra effort
    debajyoti

    Hi debajyothi
    First of all which date field you want to restrict to systems date can you be more specific debajyothi
    But In VOV8 , there is a pricing  date field  , if you customize it as per your requirement , like if you keep it blank then it will be systems date , or billing date , delivery date etc this can be one input if it is related to pricing
    Even as you said in copy controls if you change the sub- routine then it will work
    Regards
    Srinath

  • Calculating years between 2 date fields

    I am trying to build a form in LiveCycle Designer 7 to report missing persons.  I would like to populate a text field with the number of years between two dates entered in date/time fields; specifically using a missing person's DOB and the date they were last seen to calculate their age when last seen.
    Any assistance would be greatly appreciated.
    Thanks
    Drew

    Greetings,
    I need an age in months and years.
    On my LiveCycyle form I have two date fields 'dob' and 'rdtestdate'.  I am in Australia so we use dd/mm/yyyy as the format.
    The field designated to display the calculated result -- 'rdage' -- is set as a calculated-read only text field.
    What javascript/formcalc code would I use to calculate the age in years and months, please?
    I've been studying and testing the various solutions but don't understand well enough, sorry!  When I paste in a sample and change the field names to match mine, my result remains empty.  Sometimes I get a failed script message as I try to save the form.    I've tried quite a few different scripts to no avail.
    Thanks for any assistance.
    jeannie

  • Analyzer calculation of sum without not available data fields

    Hi,<BR><BR>I use Hyperion Analyzer 6.1.1.00206. I would like to calculate sum of some members.<BR><BR>So I did the following Analysis Tools | Calculations and selected the sum of desired members.<BR><BR>But if data field does not have a value (no data = n/a) then sum of members is also n/a (no data)!<BR><BR>Is there a way to specify the "not available" is treated as 0?<BR><BR>Thanks,<BR>Grofaty<BR>

    Yes, Click on File, then Preferences then DEFAULT FORMATTING TAB and at the bottom it gives you the option of selecting <BR>"REPLACE MISSING DATA WITH" Zero or text. I believe yours is set on text "n/a". Just select "zero" button and click ok. This should solve the problem. Best of luck<BR><BR>Benjamin M Hoffmeyer<BR>Marketing Analyst SSP CIRCLE K

  • Restricting date selection of the calender date field

    Right now we have a web app where you choose the starting date of a work week. We're using the calender date field to get that date. However, our client wants to restrict that to just the Mondays of the month. Is it possible to do this?

    Hi Nagy,
    The way I would approach this is by implementing that kind of calendar picker myself, from some jQuery plugin or maybe a couple of simple dropdowns, and then use javascript to populate the current date field which would be hidden. You just have to make sure that the date format looks like this:
    03-Oct-2012
    Cheers,
    -mario

  • Locking a calculated date field

    I have a date field on my form using the custom current date object included in Designer 8.2, which applies the following FormCalc script to the LayoutReady event of the field:
    // Current Date in short-style date format.
    $.rawValue = num2date(date(), DateFmt(1))
    My problem is this: the date is set when the user fills out the form, as expected. However, whenever the form is subsequently opened, the date is updated to the current date. I need to have the field set initially when the user fills out and submits the form, and then make it static so that future reviews of the form show the initial date. I know this is probably something very simple, but I am missing it. Any suggestions?
    Thanks in advance,
    Angie

    I found this script the other day that seems to do the trick:
    if ($.rawValue==null)then
    $.rawValue = [put your script here]
    else $.rawValue
    endif

  • Calculating a date field

    Hi Everyone,
    In my input form, i have 2 date fields (effective date and end date).  I want the end date to be defaulted to 1 year after the effective date.
    How do i accomplish this??
    Thanks
    Arnil

    Hi,
    use the formula in Default value of End date field:DADD(@Effectivedate,1,'Y').
    General formula:DADD(d,n,dateunits).
    Regards,
    Govindu

  • Replacement for FormCalc Date2Num Date Field Calculations in Mobile Forms?

    I have a number of forms that use the FormCalc Date2Num function. According to the Adobe documentation this function is not supported in mobile forms. If I were doing pure html5 forms I would use a JavaScript library to use a similar function. What's the best practice for handing Date2Num in Mobile Forms?

    What's the formatted value of your date field?

  • Data fields in dso

    Hi
    If I need to calculate amount based on source and destination,and if these two source and destination fields char are there in data fields of dso and keyfigure amount is also in data fields of DSO can we get exact value if make report on this.
    thx
    rubane

    Actually i need to build report where in rows there will be some char
    like source plant and destination plant and in rows on the basis of source and destination the cummulated value of amount base on some other few restriction
    now my question is :-
    acc to my need I need to make genric extractor but one is already there which contains all my fields. now can i use the same extractor,but the worry is ;these all feilds are first going in dso and all are there in data fields coloumn
    What I'm thinking is; it will suppress or accumulte records on the basis of key field's(as usual).
    so can you pls let me know what to do in this scenario?
    how to build a new report using existing extractor ;can i use existing one?
    rubane

  • Error While using date fields in HIbernate Criteraia

    I am trying a sample applciation using Hibernate with JPA. I am using annotations to map database table with Java class.I am using org.hibernate.Criteria to form where clause. My code looks as follows:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("PERSISTANCE_UNIT");
    EntityManger em = emf.createEntityManager();
    Session session = em.getDelegate();
    Criteria criteria = session.createCriteria(MyDO.class)
    criteria.add(Restrictions.eq("myDO.date",myDO.getDate()));
    List list = criteria.list();
    I am searching the data base based on the date field (myDO is an instance of MyDO.class which contains the mapping to the data base table). While running the application first time after publishing to server, I am getting the following error. For subsequent running of the application I am not getting any error and the appliaction was running with actual results.
    JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: -181, SQLState: 22007
    JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE
    org.hibernate.exception.DataException: could not execute query
         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.loader.Loader.doList(Loader.java:2223)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
         at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    Can anybody help in fixing the problem.
    Thanks in advance.

    Resolved the issue by setting System date where expected

  • SAP R/3 Tables without Date fields

    I am trying to import data from SAP R/3 into MS SQL DWH.
    There are tables which doesnot have posting date fields.
    Can anyone tell me how to map them with those Table which will have posting date fields, so i can create view in SAP and then pull that view into SQL DWH restricting on date.
    Following tables which doesnot have date fields i want to pull date for month of July 2007;
    EKBE
    EKKO
    MAKT
    MSEG
    KSEG
    AFPO
    JEST
    JCDS
    MARA
    AUFK
    COEP
    RESB
    MARC
    I am not a ABAP developer just trying to get my data from SAP, so please answer in detail.

    BUDAT is the technical name for Posting Date field. This field is used many DB Tables/ Strucutres. Using where used option you can find the required tables.
    I suggest you to look at BSEG table for Finace Document postings by Posting Date.

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • How do I populate my date fields placed on Master Page for multiple pages?

    I have a dynamic form with flowing fields. I inserted date fields using the Master Pages tab within Adobe LiveCycle Designer ES2, Windows 7 OS. I have only 1 Master Page. Everything on the form is working properly, except when I have multiple pages, the date fields are blank on all but the first page. One of the date fields has javascript in the exit event to calculate the second date field. I can manually edit the subsequent page(s) date fields, but I don't want the end user to have to do that. I want the date fields on the new pages to equal the date fields on the first pages. Below is my output with notes to provide a visualization of what I'm looking for.
    Many thanks in advance for anyone who can help me with this issue!
    Caroline

    Hey Mandy,
    Yes, both date fields are on the Master Page. The first one is set to "User entered - Required" and the second to "Calculated - User Can Override"
    And that's right, I used your script to calculate the second date field. The only thing I changed was the field name, and used 6 days instead since I wanted the calendar days to only run a full week, like start on a Monday and end on Sunday.
    Thx,
    C

Maybe you are looking for

  • My itunes won't open and an agreement page pops up and then goes away!!!

    Yea so I've been on this crappy computer for over five hours trying to get songs on my ipod video.I went and downloaded the ewido thing, and the adware but it still didn't open so i deleted all of my firewall stuff and it still didn't work. I have a

  • Excise in free goods sale

    Dear All i've configured free goods sale(samples) which are excisable.wherein we don't collect excise from customer. but, as per the configuration,from commercial invoice the accounting entries are 1.)customer account - debit(RS:266.76) 2.)Gross sale

  • RTF for PO Out for communication

    Hi All, My question is for all people who have succeeded in creating a rtf template from scratch for a Purchase order using the standard XML obtained from XML Publisher Responsibility. I want to the know the procedure to do. I am trying to create it

  • Giving error

    GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER   PROCEDURE [dbo].[SearchSubsubCategory] @Category1 nvarchar(50), @SubCategory1 nvarchar(50), @SubSubCategory1 nvarchar(50), @Sort nvarchar(100), @SortDirection nvarchar(100) AS BEGIN SET NOCO

  • SAFARI COMPLETELY LOST ABILITY TO LOAD IMAGES

    .... no idea what happened but all the images from all sites just won't load anymore .... this is what Safari looks like http://grab.by/nAog Chrome works fine. I have never seen anything like this before. It's the latest 6.05 on a brand new iMac with