HELP!! Can't calculate date fields

I have a cript that calculates between 2 date fields.
They have a date format of: DDMMYYYY
In an other form with a different date format it works, but here it doesn't
What am i doeing wrong?
var dateOfPensioen = formulier1.Formulier.Vraag2.RetirementDate.Date2.rawValue;
var dateOfChange = formulier1.Formulier.Vraag1.Date.Antwoord4.rawValue
var Horizon = 0;
if (dateOfPensioen != "" && dateOfChange != "")     {
var datePensioen = util.scand("yyyy-mm-dd hh:mm", (dateOfPensioen + " 0:00"));
var datePeil = util.scand("yyyy-mm-dd hh:mm", (dateOfChange + " 0:00"));
if (datePensioen != null && datePeil != null)
// calculate horizon in months
var calcHorizon = ((datePensioen.getFullYear()-datePeil.getFullYear()) * 12 + (datePensioen.getMonth() - datePeil.getMonth()) - Math.max(0,Math.min(1,(datePeil.getDate()-datePensioen.getDate())))) / 12;
var Horizon = calcHorizon.toString();               }
I'm keep getting an error: util not defined

Logic for date range overlap testing only requires two conditions in the WHERE clause:
ORACLE-BASE - Overlapping Date Ranges
WHERE S.STARTDT <= :ENDDT AND S.ENDDT >= :STARTDT -- TRUE for ranges that overlap
It looks a little odd, but, if you scribble out a 'logic table', it makes sense.
Condition
A.start <= B.end
A.end >= B.start
A__A B--B
true
false
A__B=A--B
true
true
A__B==B__A
true
true
B--A==B__A
true
true
B--B A__A
false
true
MK

Similar Messages

  • How can I update data fields in a merged document ?

    Hi,
    I'm looking for a way to update the values of data fields in a merged document with a script just as you can do with the user interface.
    I don't find any method like "updateDataFields ()" in the DataMerge object.
    Si I try to invoke the menu action "Update Data Fields", but it fails. The script error message is: "Error 53762, the script is not active." On the contrary, the action works if I use the interface.
    Can anyone help me?
    Thanks in advance,
    FredIsnard
    PS : I work with CS5.5 and JavaScript.

    Hi!
    You might be looking for this one:
    DataMerge.mergeRecords (outputOversetReportFile: File )
    Merges records and produces an optional overset report.
    outputOversetReportFile: Data Type: File
    The path to the file in which to store the overset report. (Optional)
    Best regards,
    Andreas

  • Help BC Webform custom date Field

    I have a BC webform which I have decided to use a custom field as the date field, because BC Date picker is buggy for users. This is my webform:
    <form name="catwebformform72193" method="post" onsubmit="return checkWholeForm72193(this)" enctype="multipart/form-data" action="https://myastymin.worldsecuresystems.com/FormProcessv2.aspx?WebFormID=104882&OID={module_oid}&OTYPE={module_otype}&EID={module_eid}&CID={module_cid}&CC={module_urlcountryc ode}&Referrer={module_siteurl,true,true}">
      <span class="req">*</span> Required
      <table class="webform" cellspacing="0" cellpadding="2" border="0">
        <tr>
          <td><label for="Title">Title</label>
            <br />
            <select name="Title" id="Title" class="cat_dropdown_smaller">
              <option value="299539">DR</option>
              <option value="299538">MISS</option>
              <option value="299535" selected="selected">MR</option>
              <option value="299536">MRS</option>
              <option value="299537">MS</option>
            </select></td>
        </tr>
        <tr>
          <td><label for="FirstName">First Name <span class="req">*</span></label>
            <br />
            <input type="text" name="FirstName" id="FirstName" class="cat_textbox" maxlength="255" /></td>
        </tr>
        <tr>
          <td><label for="LastName">Last Name <span class="req">*</span></label>
            <br />
            <input type="text" name="LastName" id="LastName" class="cat_textbox" maxlength="255" /></td>
        </tr>
        <tr>
          <td><label for="CAT_Custom_352788">Date of Birth <span class="req">*</span></label>
            <br />
            <input type="text" maxlength="4000" name="CAT_Custom_352788" id="CAT_Custom_352788" class="cat_textbox" /></td>
        </tr>
        <tr>
          <td><label for="EmailAddress">Email Address <span class="req">*</span></label>
            <br />
            <input type="text" name="EmailAddress" id="EmailAddress" class="cat_textbox" maxlength="255" /></td>
        </tr>
        <tr>
          <td>{module_ccsecurity}</td>
        </tr>
        <tr>
          <td><label for="Username">Username <span class="req">*</span></label>
            <br />
            <input type="text" name="Username" id="Username" class="cat_textbox" maxlength="255" /></td>
        </tr>
        <tr>
          <td><label for="Password">Password <span class="req">*</span></label>
            <br />
            <input type="password" name="Password" id="Password" class="cat_textbox" maxlength="255" autocomplete="off" /></td>
        </tr>
        <tr>
          <td><label for="PasswordConfirm">Confirm Password <span class="req">*</span></label>
            <br />
            <input type="password" name="PasswordConfirm" id="PasswordConfirm" class="cat_textbox" maxlength="255" autocomplete="off" /></td>
        </tr>
        <tr>
          <td><input type="checkbox" name="CampaignList_223" />
            Subscribe to: Astymin Postboard</td>
        </tr>
        <tr>
          <td><input type="checkbox" name="CampaignList_224" />
            Subscribe to: Postboard Users Birthday Card</td>
        </tr>
        <tr>
          <td><input class="cat_button" type="submit" value="Submit" id="catwebformbutton" /></td>
        </tr>
      </table>
      <script type="text/javascript" src="http://www.myastymin.com/CatalystScripts/ValidationFunctions.js"></script><script type="text/javascript">
    //<![CDATA[
    var submitcount72193 = 0;function checkWholeForm72193(theForm){var why = "";if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, "First Name"); if (theForm.LastName) why += isEmpty(theForm.LastName.value, "Last Name"); if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value); if (theForm.Username) why += isEmpty(theForm.Username.value, "Username"); if (theForm.Password && theForm.PasswordConfirm) { why += isEmpty(theForm.Password.value, "Password"); why += isEmpty(theForm.PasswordConfirm.value, "Confirm Password"); if (theForm.Password.value != theForm.PasswordConfirm.value) why += appendBreak("- Password and its confirmation do not match."); if (theForm.Password.value.length < 6) why += appendBreak("- Password must be 6 characters or longer."); } if (theForm.CAT_Custom_352788) why += isEmpty(theForm.CAT_Custom_352788.value, "Date of Birth");if(why != ""){alert(why);return false;}if(submitcount72193 == 0){submitcount72193++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}
    //]]>
    </script>
    </form>
    But I want the date field (highlighted) to look like this Well formatted date of birth input field - JSFiddle (The Date Format Normal. Not the tab option. I mean the second styling ). Issues like validation and should each date parameter be a separate field, etc is my headache. Please can someone kindly look into this BC webform and kindly help. Kind regards.

    Hi,
    I think only CHAR and NUM data types are allowed in OXK3, not possible to assign dats.
    Thanks,
    Shailaja Ainala.

  • In BDC programming how can we maintain date field

    hello all
    In BDC programming how we will deal with date field?
    In my flat file my date field format is different from the sap date field format. how can we deal this?

    hi,
    just define a variable with length 10 in ur internal table.
    now pass the date format in flat file as dd.mm.yyyy.

  • How can I calculate data matching specific criteria

    I am trying to dynamically fill cells if certain criteria are met in another table.
    The first table is a line item account of:
    A person's Name
    Number
    Date
    The second table lists:
    Person's name
    total (calculated from the number column in first table if certain criteria is met)
    The problem is, that since there is no easy find & replace in selection only option, I have to edit each cell's formula manually which would take a long time.
    Currently I have this formula which works-
    =SUMIFS(Table 1 :: $B$2:$B$573,Table 1 :: $A$2:$A$573,"=Person's Name",Table 1 :: $C$2:$C$573,">=2/1/08",Table 1 :: $C$2:$C$573,"<=2/28/08")
    With this formula, I have to manually set the "=Person's Name" in every cell. What I would like to do and feel should be possible, is dynamically set the Person's Name from another cell.
    I tried:
    =SUMIFS(Table 1 :: $B$2:$B$573,Table 1 :: $A$2:$A$573,"=$A2",Table 1 :: $C$2:$C$573,">=2/1/08",Table 1 :: $C$2:$C$573,"<=2/28/08")
    So that it would look at the value of the Person's Name in Table 2, but that returned an error. I think that is because it is trying to create a numerical value for the Person's Name.
    Next I tried:
    =SUMIFS(Table 1 :: $B$2:$B$573,Table 1 :: $A$2:$A$573,"=(=$A2)",Table 1 :: $C$2:$C$573,">=2/1/08",Table 1 :: $C$2:$C$573,"<=2/28/08")
    In the hopes that it would try to work around Numbers trying to create a numerical value for the Person's Name, but that returned an error as well.
    Please, if you have any suggestions, that would be awesome because for each person I am doing this calculation many times. I am calculating values for every month for the past 3 years, and that's 36 individual cells to write formulas for and I have 50 some people to do this for.
    Thanks for your help.

    I think you were on the right track with
    =SUMIFS(Table 1 :: $B$2:$B$573,Table 1 :: $A$2:$A$573,"=$A2",Table 1 :: $C$2:$C$573,">=2/1/08",Table 1 :: $C$2:$C$573,"<=2/28/08")
    But there is a problem in this formula. The "=$A2" should be replaced with a simple $A2. No quotes, no equals sign. Or it could be written as "="&$A2. Even so, you should not have received an error triangle the way you wrote it, you should have gotten an incorrect answer. If you were receiving an error triangle, it is probably due to something other than the format of the formula. Can you tell us what that error message is?
    I would also suggest you replace $B$2:$B$573 with plain old B, which will refer to the entire column except any headers and footers. Same with the ranges for the A and C columns.

  • Help - can't migrate data via firewire to new MB

    I'm migrating from a PowerBook running Tiger to a new MB with Leopard (10.5.2). I tried using Migration Assistant but I kept getting errors about a problem with the network even though I was using FireWire.
    I figured it's probably better doing it manually by FireWire anyway, so I used FireWire target mode. But when trying to copy over my documents, it's stopping at a certain point, different each time. And it won't let me cancel, the Finder freezes up, and I have to force shut down. I've tried a couple times, one time it did give me an error for a particular file, but that seemed to copy over in the first attempt.
    I suppose I'll have to try to call Apple, but anyone have any advice? I already gave the MB a fresh reinstall of Leopard.

    gbarron wrote:
    I have all the old iMac data backed up to a hard drive, but would prefer not to "handload" all my files fromt eh harddrive to the new iMac.
    Backed-up how? If you have a Time Machine backup, or a "bootable clone," just plug it in to your new Mac and migrate from it. See [Setting up a new Mac from an old one or its backups|http://web.me.com/pondini/AppleTips/Setup.html] (or use the link in *User Tips* at the top of the +Snow Leopard > Installation and Setup+ forum).

  • Calendar in F4 help of additional data field

    Hi Experts,
    my query is regarding calendar to appear as an f4 help for the additional data field in DIR. is any function module need to be specified at the time of creating characteristics (if yes please guide)?
    thanks and regards,
    Shikha Gupta.

    hi,
    Logic is like this.
    Here u are defining perticular character to DIR  which belongs to your document type.
    when u assign this value to DIR which is help full in search DIR in CV04N.
    Note: i don't think u need calander in defining Characteristics. u could check format, for Data type only DATE is given insted of calander in CT04.
    If u want include Calander in Data type, then u ask abaper[development].
    i think this is very tedious job.
    Benakaraj
    ??P

  • How to calculate Date and Days

    Hi BW Experts,
    I have requirement, I have field original GI Date and  it is calculating based on 'Original promise date'-'Transport time'. Formula is 'Original GI Date' = 'Original promise date'-'Transport time'.
    We are getting data for original promise date as Date format and  Transport time as Days (ex: 1 or 2 days).
    Here, how can I convert into Date or how can I calculate Date and Days. I am working on BW3.5 .
    Please help me how can I overcome this requirement.
    Points will be assign.
    regards
    Yedu.

    Hi Ventatesh
    It's not a problem
    You can subtract days from date to get the resultant date
    Original Promise time  =  GI Date  - Transit time ( in days)
    Add Original Promise Time in your data target and fill that up with the above rule.
    If the above is not working you can use this function module
    DATE_IN_FUTURE
    Here you need to pass Date and Days to get future date. Only trick you need to apply that if the transit days is 5 days, you pass -5 to this function module.
    But this function module is not available in BW system. Just copy the code from ECC system and create a Z FM for BW system
    Regards
    Anindya
    Edited by: Anindya Bose on Feb 9, 2012 4:36 AM

  • Is there a way to import a indd CS4 file with its Data Fields names and properties into CC?

    I have to convert numerous files from CS4 to CC. The CS4 files are using external data from a CSV file. When I open the file in CS4 I can enable the preview and see the data from the CSV file. But when I save the file as indd or idml and try to open it in InDesignCC then I can't see the data as preview. I can see the Data fields (text).I think it's because it doesn't recognize the data fields from the CS4 file. If I delete a data field and remap it I will be able to see the preview for the field I just mapped. the other fields remain the unchanged, like they were just text.
    Any help with this topic will be very appreciated. I have about 70 data fields per document and about 100 documents to go through.
    Update: The symbol for a data field, ex: «fullname_2» change size when I delete and remap it. Explanation: When I open the CS4 file in IndesignCC I can't view a preview of the Data field(s) (almost positive because it's plain text). The data fields show like this «fullname_2». But when I delete that and drag a field from the data field list it shows like this <<fullname_2>>. So definitely, CC is not reading the data fields from InDesign CS4.
    P.S.: The fields above («fullname_2» and <<fullname_2>>  are copy and paste from Indesign CC.

    I'm attaching this image so this forum can notice the difference on the Data fields from CS4 and the ones added on CC

  • Changeable Current Date field

    I need the "Current Date" field enabled to be changed by the user. Any help will be appreciated.
    I thought the "Calculated - User can Override" would work but no such luck! (I am using the Custom - Current Date field)
    Thanks

    Hi,
    The custom current date has the script in the layout:ready event. This fires everytime the user exits an object that has been changed.
    So what is happening is that the user can access the date field and change the value, however when they exit the field, the layout:ready event fires and the user-entered data is overwritten by the current date.
    You could move the script from the layout:ready event to the docReady event. This is a good event because it only fires once, when the form is opened/rendered.
    You will probably need to wrap the script in an if statement, so that when the form is reopened, it does not overwrite the date. The following FormCalc should work:
    // Current Date in short-style date format.
    if (HasValue($) eq "false") then
         $.rawValue = num2date(date(), "DD.MM.YYYY")
    endif
    There is an example here: https://acrobat.com/#d=QR1y1RYatwSaQAWa4-jLlA
    You can see events and how they fire here: http://assure.ly/gW3RNr
    Hope that helps,
    Niall

  • Date Field (MON-YYYY)

    Can somebody help me to display and enter in date field like MON-YYYY.So it will save also like that in database.

    User,
    What is your name?
    Dates are not stored like that in the database. Dates in the database store both date and time with accuracy up to seconds. You can "truncate" a date field to fit your needs and then format it when you need to display it. In your example you only need accuracy up to the month so you could store a date as TRUNC(SYSDATE, 'MONTH'). Note that this would be saved as 01-FEB-09 12:00 AM.
    However, TRUNC is not needed if you create a date without that accuracy to begin with as in TO_DATE('FEB-2009','MON-YYYY'), this would be the same as above.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Date Field to Load the full load data

    I have a master data fields like plant, factory, Industry units and Machine Areas all in sequential hierarchy in my data source these all have "valid to" and "valid from date". Now i want to load this Data source with full load on a monthly basis.
    1. Please tell me how can I add data field that captures all records for a month
    2. Valid From field is there but if i say 07/01/2007  as valid from it will not pull the previous one.
    3. Please let me know the step by step approach to make the full load on monthly basis. I do not have any other date field in datasource other than valid from and valid to which are date char 8 yyyymmdd field example factory valid fr = 01/2008
    valid to 08/2008
    like that. Please send me any documents or abap code that can solve this
    [email protected]
    Please help me to solve this
    Thanks
    Poonam Roy

    Hi,
    It seems yopu have already deleted the data for one month from the cube??
    Should not have done that as DSO would have picked the delta correctly.
    Just make sure that the delta was not too much high or it is better to run full repairs.
    If you have deleted the data from the cube then do the full repair for the cube from the DSO for the same selections which you have deleted from the cube.
    It will correct the data in the cube.
    And no need to do reinit after that as it will pick the delta correctly for next time.
    Thanks
    Ajeet

  • Identify key fields and data fields

    Hi
    i have datasource 0co_om_cca_9 .
    i want build 1 DSO, how can i identify what are key fields and data fields to build DSO based on that datasource.

    Hi sunnel,
    The DSO are like 2-D database tables.
    We use the technical keys here in counterpart to the business keys in Infocubes.
    The key fields are the one based on which the records are identified uniquely in the database table.
    And the data fields are the ones which are aggrgated or summarised or overwritten based on the value in key filed.
    For example:
    The ID no.s of the employees will be unique and it can be used as a key field.
    The feilds like the Salary taken by the employee every month :"SALARY"
    and the no. of leaves they taken: " NO. OF LEAVES" can be used as data fields.
    So that the salary or the leaves taken by a particular employee can be aggregated based on her/his ID no.
    The key fields in DSO doesnty mean Key figures.The key field means any unique key or a key based on which the records are sorted in the DSO
    And key figures are the data fields.Some of the Characteristics can also be data fields in DSO.
    Please give points if u r satisfied wit the information
    Also let me know if u hav any doubt and if any thing is wrong.
    Regards,
    Kalpana M

  • To Display a date field in TSTCT table

    Dear Experts,
    Recently we got a request to have a date field in TSTCT table. So, that when ever the new transaction is created the date will automatically display  in TSTCT table. Now there is only three fields in the table. There is no further settings to regarding the display of date field. Is there any possible cases/BADI's which helps to display the Date field in TSTCT Table. Please help me with possible solutions.
    Thanks in advance, Regards,
    Harsha.

    Dear Eswara,
    It is not possible adding field through BADI or exit. But you go into /nSE11 for this table and go to Technical Settings, if the check box 'Log Data Changes' is set then you may be able to display a log of changes made to entries in this table using /nSCU3.
    Regards,
    Abbas.

  • Audit trail date field

    Is there a way I can extract the audit trail dates for historical reporting? I want to know if I can add that date field as a customized field.
    Thanks

    I think there are few subject areas that have SCDs (Slowly Changing Dimensions). In such cases you will be able to report on the date-wise changes.
    One such subject area is "Sales Stage History". I suspect the out of box "Sales Stage History Analysis" report to be based on that subject area.
    Prakash

Maybe you are looking for

  • Can I set up a Mac Pro as a server using OSX Server for my current Windows-based office?

    I have a small business, and our office currently has a Windows-based network.  I love my Mac and it's ease of use, and for now I have to use Remote Desktop to log on to my server, and then run my MRP/ERP business software from that.  Is there an App

  • SMS Provider Locations Do Not Match - Problem installing SCCM 2012 R2 CU4

    I have an SCCM 2012R2 CU1 site that has been upgraded from SCCM 2012 non-SP1, so I have gone from 2012 to 2012SP1 through CU5 and then to R2 and then to CU1. Over the course of the life of this site, which has more than 10k clients and 10 Site System

  • IMac not COMPLETELY powering down...

    Morning all... I upgraded my 24" iMac (bought Jan 2007) to Leopard on Saturday, and apart from a few minor software funnies, it seemed to go OK. I just upgraded - not archive and install or anything complicated like that. The problem I now have is th

  • Subinventory transfer

    Hi Gurus, I am using wsh_deliveries_pub.delivery_action api to backorder.But quantiy from staging sub inventory is not going back to FGI subinvenotory. Do i need to call a separate api for this.Or it needs to be done manually.If api is avalable could

  • Transport Text elements

    Hello ABAP experts, I have created a program and also text symbols. I am trying to transport both. to transport the program i did Menu: goto > object directory entry > selected the package > selected the request. in se09 i could see the entry as R3TR