Current date - user entered days

Hi all
I have this scenario:
I have safety stored as attribute of material.
I have to do some calculation based on this so i created a replacement path variable and used replace  with attribute value.
Now i have 2 safety stock:
1. Current ( safety stock restricted to current date )
2. Safety stock Past : restricted to  (current date - User entered no of Days).
How to calculate the second one in 2004s??
Thanks

Hi Srini
Thanks for quick response. here is the issue. The safey stock needs to be calucated for just that day. so it not aggregated from current date- user entered days to current date.
ex:
Current Safety Stock (10/26/2007)    Safety past (10 /26/2007 - 7 days) ( user enters 7 days)
100                                                      200
So how to restrict Safety past to the date which is current - user enetered no of days.
Thanks
Pankaj

Similar Messages

  • How does BR get current date, user, and associate member with Attribute Dim

    I need use Business rules or Calc script to implement following functions:
    1. Get current date and the name of user who is running the BR and save the information to cube.
    I don't find any functions to get current date and users.
    Also, since text and date is store in relational database and essbase cube only stores the index, it looks that the value can't be changed or stored by using "==" directly, is there any function to change value of members with Text or Date types in BR/Calc script?
    2. End users select attribute value (via smart list) of products or projects(Sparse dimensions) in data form, run BR to update the association of these members with attribute dimension.
    I don't find any functions to change the attribute association in BR/Calc, is there any CDF (Custom Defined Function) that can do it?
    Thanks!

    Hi,
    For the date functionality, check out the post below.
    Re: Days behaviour between two dates
    As for the username, there is a little tricky way that requires an unused or a new dimension along with a smart list of user names. It's also possible to capture the user name from the cookies and pass it on to the form. The latter is possible through validatedata.js however requires hefty coding here and there.
    As for the attributes, it's not possible to update metadata through business rule. So no luck in there.
    Cheers,
    Alp

  • Datepicker - setting selected date as current date plus 3 days

    Hi,
    I have a datepicker in my visual webpart.
    I want to set by default as "today's date + 3 days".
    Example: if today is 25 Feb, then the datepicker should have selected date as 28
    I am aware of this:
    DTDefaultDate.SelectedDate = DateTime.Today;
    How to add the 3 days to it?
    Thanks

    Hi,
    If you want to set the DateTimeControl to a specific date, please take the code below for a try:
    DateTimeControl1.SelectedDate = DateTime.Today.AddDays(3);
    More information about DateTime.AddDays Method:
    https://msdn.microsoft.com/en-us/library/system.datetime.adddays(v=vs.110).aspx
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Add one day to the current date

    Hi all,
    A stupid question...
    How can I add one day to the current date in a select. I want something similar to add one month to current date, but with days:
    something like:
    select TO_CHAR (ADD_MONTHS (SYSDATE, -1), 'DD-MM-YYYY')
    from dual
    Thanks

    select sysdate+1 "add one day" from dual;

  • Current date minus 365 daqys

    In MS BI Query Designer I want to query the last 365 days from a DB2 table.  I can pull this data from Access, but can not figure out how to select the dataset for current date minus 365 days.  Here is what I have that works in Access
    select txn_date   (format is MM/DD/YYYY)
    from Inventory
    where txn_date >Date()-365
    I've tried Date(), NOW(), Getdate() and date_add(), but not having any luck .  Your assistance would be much appreicate.

    Hi Rkk5,
    According to your description, I suggest you referring to the command below:
    select txn_date  from Inventory
    where datediff(D, txn_date  ,(GETDATE()-365))<0
    Hope this helps.
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

  • Leopard update ical dock not keeping current date

    since the update last week, the dock icon has stopped keeping the current date. the first day I noticed it stopped updating I did a kill dock. stayed on that day.
    I removed it from the dock, then re-added it, keeps that date.
    anyone else, is this a know issue?
    thanks

    go to the dock, trash the ical icon there, then go to the applications folder, and drag a fresh ical icon to the dock.
    also would be a good idea to do a software update before that if your the OS in your profile is correct
    hope this helps

  • Current date as deafult for Calender Day and user entry

    Hello All,
    There is a select option for Calender Day for a BW query.
    This Calender Day should have a default as Current Date and User entry is also possible.
    I have used a Customer exit and written the following code under i_step = 1
    data: v_currdt like sy-datum.
    clear: v_currdt, vfl_range.
             if i_step = 1.
              vfl_range-sign = 'I'.
              vfl_range-opt = 'EQ'.
              v_currdt = sy-datum.
              vfl_range-low = v_currdt.
              append vfl_range to e_t_range.
             endif.
    Please inform if this code is incorrect, because I am not able to see the date at all.
    Cheers,
    KP

    Hi
    Check with this code!
    Implemented for the same function as you require.-
    if i_step = 1.
      case i_vname.
        WHEN 'ZZZZZZ'.
          IF i_step = 1.
            REFRESH e_t_range.
            CLEAR l_s_range.
            l_date1 = sy-datum.
            L_S_RANGE-LOW = l_date1.
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT  = 'EQ'.
            APPEND L_S_RANGE  TO E_T_RANGE.
          endif.
      endcase.
    endif.
    Regards
    M.A

  • How to compare user entered date with current date

    Hi all
    my requirement is, user allowed select one date, in code i have compare this date with current day date. it should be 15days gap other wise display error message.
    I am worried about how to get current date in code. Is there any code to get current date. please reply me with code or mail me at [email protected]
    Thanx
    keerthi

    Keerthi,
    Use the method <b>getDifference()</b> of the DateHelper.java available here.<a href="http://www.koders.com/java/fid14A61FEB1B45A64E42E1DCAD7070B46AE46340BA.aspx">DateHelper</a>
    1. Create a new folder, say Util under your src folder. (com.xyz.util)
    2. Put this DateHelper.java file in that folder,(com.xyz.util) .
    3. Now, write an import statement for this java class in the required view.
    4. Use the getDifference() method of this class to the difference in days between two days.
    Or
    Simply use this code.
    // Get msec from each, and subtract.
    long diff = currDate.getTime() - selectedDate.getTime();
    int noOfDays = diff / (1000 * 60 * 60 * 24);
    where currDate is today's Date and selectedDate is the Date selected by the User.
    Bala

  • Add days to the dates when user enter +

    hello ,
    i have requirement that when user enter + 30 in date field he got + 30 dayas of current date is thr any why to do this it is modulpool and i have taken date field on screen.

    here is sample code to show next and previous month on button click and show current month
    and year default.
    REPORT  ztn_datechk_button.
    TABLES sscrfields.
    TYPE-POOLS icon.
    DATA month TYPE i.
    PARAMETERS: date TYPE spmon .
    INITIALIZATION.
      date = sy-datum+0(6) .
      "date = sy-datum+0(2) - 1.
      IF date+4(2) < 1 ."or date+4(2) > 12.
        date+4(2) = 12.
        date+0(4) = date+0(4) - 1.
      ELSEIF date+4(2) > 12 ."or date+4(2) > 12.
        date+4(2) = 1.
        date+0(4) = date+0(4) + 1.
      ENDIF.
      SELECTION-SCREEN  PUSHBUTTON 50(15)  but1 USER-COMMAND prev VISIBLE LENGTH 3.
      SELECTION-SCREEN   PUSHBUTTON 53(15) but2 USER-COMMAND next VISIBLE LENGTH 3.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name   = icon_previous_value
          info   = 'PREVIOUS'      "text = 'Button 2'
        IMPORTING
          RESULT = but1
        EXCEPTIONS
          OTHERS = 0.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name       = icon_next_value
          info       = ''      "text = 'Button 2'
          add_stdinf = ''
        IMPORTING
          RESULT     = but2
        EXCEPTIONS
          OTHERS     = 0.
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'PREV'.
          date = date+0(6) - 1.
          IF date+4(2) < 1 ."or date+4(2) > 12.
            date+4(2) = 12.
            date+0(4) = date+0(4) - 1.
          ENDIF.
        WHEN 'NEXT'.
          date = date+0(6) + 1.
          IF date+4(2) > 12 ."or date+4(2) > 12.
            date+4(2) = 1.
            date+0(4) = date+0(4) + 1.
          ENDIF.
      ENDCASE.
      IF date+4(2) < 1 OR date+4(2) > 12.
        MESSAGE 'Invalid Month' TYPE 'E'.
      ENDIF.

  • I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so

    I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so.  THere are  no options for just  date .

    christine275 wrote:
    ... (this is a time worked by date and not always entered on the date worked)--
    "Time" in Numbers is always "Time of Day", and is always part of a Date and Time value. "Amount of Time" is a Duration value, which may be displayed in a similar format to "Time of Day," but is a different type of value.
    If you are entering the number of hours and minutes worked, format the column as Duration, set the units and the format in which you want to have the value appear.
    The Date column will still contain a Date and Time value (Jan 1, 2011 00:00:00 in the cell shown in the example), but the "Time Worked" cells will contain only a Duration value.
    Incidently, the Date in A2 was entered as "jan 1" (without the quotes). Numbers automatically adds the current year and the default time value, then displays the result in the closest format to what you've entered, or in the Date and Time format you have chosen.
    The Duration value in B2 was entered as 3:15 (as displayed). Note that in the entry bar the duration is displayed as 3h 15m, probably to distinguish it from a similarly formatted (Date and) Time value.
    Regards,
    Barry

  • How to get 1 day less than user entered date

    Hi
    There is a user entry for date. If the user enters 20060427 then the report should run for 20060426. I tried giving 'LT' in the CMOD code. But it gives an error. Can anyone pls help. Is there a function module for this?
    Thanks
    Suja

    Hi Suja,
    You can use Less Than and Greater than for a user entry variable as follows: When you right click > restrict the char, then in the pop up box there is a drop down for Selection. Choose Value Hange here. Then in the drop down to the right you will have values ike Between, Less Than, Greater than...you can select as required.
    Hope this helps...

  • Adobe LiveCycle Designer 8 - Add days to Current Date in another text field

    Hi-
    I am working on an expense report. I have six fields, CurrentDate, and countDate1 through countDate5. The CurrentDate is a Time/Date field which the user can select whatever date is needed with the drop down calendar. The other five countDate fields are "text" fields which will represent Monday through Friday. I would like to add zero days to whatever the user selects as the CurrentDate and make that appear in countDate1 which represents Monday(the CurrentDate the user selects will always be a Monday), add one day to whatever the user selects as the CurrentDate and make that appear in countDate2 which represents Tuesday...and so on. I realize this is probably basic for someone familiar with FormCalc but I'm very new at this.
    This got me very close but I want the user to select the date and not have the CurrentDate already filled in.
    CurrentDate - DateTime field, FormCalc calculation script:
    num2date(Date())
    Date1 - Text field, FormCalc calculation script:
    Num2Date( Date2Num(CurrentDate.formattedValue))
    Date2 - Text field, FormCalc calculation script:
    Num2Date( Date2Num(CurrentDate.formattedValue) + 1 )
    Thanks!
    Brian

    Here is an exmaple of adding days the script is used in the "exit" event for the date select field that has display format of "MM/DD/YYYY". Adding days requires add x number of days to the days since the epoch date for the current date, adding months or years one needs to manipulate the string parts of the date.
    ----- form1.#subform[0].InputDateField::exit: - (FormCalc, client) ---------------------------------
    // fomatted string for selected date
    var sFmtDateValue = $.formattedValue
    var sMsg = Concat("Entered date formatted: ", sFmtDateValue) // build message string
    sMsg = Concat(sMsg, "\u000a" ) // add new line to message
    // convert date string to days since epoch date - format is important
    var fDaysPast = Date2Num(sFmtDateValue, "MM/DD/YYYY")
    // add 7 days to days past epoch date
    var f7DaysPlus = fDaysPast + 7 // add 7 days
    var s7DaysPlus = Num2Date(f7DaysPlus, "MMM DD, YYYY") // format string for 7 days plus
    sMsg = Concat(sMsg, "\u000a", "Plus 7 Days: ", s7DaysPlus) // build message string
    // add 14 days to days past epoch date
    var f14DaysPlus = fDaysPast + 14 // add 7 days
    var s14DaysPlus = Num2Date(f14DaysPlus, "MMMM DD, YYYY") // format string for 7 days plus
    sMsg = Concat(sMsg, "\u000a", "Plus 14 Days: ", s14DaysPlus) // build message string
    // display results
    // work on months
    // get parts of date past epoch date
    var sFullYear = Num2Date(fDaysPast, "YYYY") // get 4 digit year form days past epoch date
    var sMonth = Num2Date(fDaysPast, "MM") // get month form days past epoch date as number
    var sDate = Num2Date(fDaysPast, "DD") // get date form days past epoch date as a number
    var s2Month = Sum(sMonth, 2) // add 2 months
    var s2FullYear = sFullYear
    // if more than 12 months in new date adjust year on number of months
    if (s2Month > "12") then
    s2FullYear = Sum(s2FullYear, + 1) // increment year
    s2Month = Sum(s2Month, - 12) // adjsut months
    endif
    var s2MonthsAdded = Concat(s2Month, "/", sDate, "/", s2FullYear) // date string
    sMsg = Concat(sMsg, "\u000a", "Added 2 months: ", s2MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
    var s5Month = Sum(sMonth, 5) // add 5 months
    var s5FullYear = sFullYear
    // if more than 12 months in new date adjust year on number of months
    if (s5Month > "12") then
    s5FullYear = Sum(s5FullYear, + 1) // increment year
    s5Month = Sum(s5Month, - 12) // adjsut months
    endif
    var s5MonthsAdded = Concat(s5Month, "/", sDate, "/", s5FullYear) //build Date string
    sMsg = Concat(sMsg, "\u000a", "Added 5 months: ", s5MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
    // display results
    xfa.host.messageBox(sMsg, "Sample Adding Days and Months" ,3, 0);

  • Calculate one month prior to user entered date by a Date/Time field

    Hi All,
    I am currently pretty new to Live cycle and have no idea about Java scripting, i have been using this site a lot for my forms and have used the FormCalc for expanding tables and so on but this one is proving difficult. I am currently designing a form that requires a calculation of one month prior to a user entered date by a Date/Time field. I have looked at multiple posts on how to do this but none have worked (they are using the Date2Num).
    Is anyone able to enlighten me please?
    I currently have:
    Date/Time field Date Due
    Date/Time field Planned Date of Review
    I need Planned Date of Review to be calculated to be 30 days prior to Date Due. How do I go about doing this? Is it incorrect to use a Date/Time field as the field type for the calculation?
    Cheers
    Brad

    You can use FormCalc to compare the user input.
    Put this script into the exit:Event of the date field.
    if (Date2Num($.formattedValue, "MM/DD/YYYY") ne date()) then
    $host.messageBox("The entered date is not todays date!")
    endif

  • Extract data on report between last 30 days from current date.

    Hi Experts,
    Ealrier i had provided user promt to select the date range, now i need to schedule the report for this i have to set the date between last 30 days from current date.
    How can i add this in formaula on record selection.
    before:
    {pm_process.pm_creation_date} in {@Start Date to UTC} to {@End Date to UTC}
    I tried:
    {pm_process.pm_creation_date} in CurrentDate() - 30 to CurrentDate()
    But this is diplaying me only data of 30th date from current date.
    Please advice.

    Hi Brian,
    Thank you!
    1. I have not created any function for {pm_process.pm_creation_date} in [CurrentDate() - 30 to CurrentDate()] i am just adding this on Record Selection and its not helping.
    2. {pm_process.pm_creation_date} in Last30Days; this is throwing below error.
    please advice what to be done?

  • How to use User entered dates in intreval

    Hi,
    User will enter date range in variable
    As per my requirment i want to use no of days between those 2 user entered dates in my calculaction
    How can i achieve this at report level.
    Thanks

    Hi
    Create a variable with intreval.
    There is a function module which calculates the no of days between the days
    Go to SE38 and ZXRSRU01 Program
    Write the Code like this (Not exact code)  you can modify
    WHEN "ZZZZZ"(Before that create a formula variable to get the number of days between the days and use the tech name of the formula variable here)
    read ..the lower limit and the upper limit of the caldaz variable
    FROMDATE = L_S_RANGE-low
    TODATE = L_S_RANGE-HIGH
    Then call the function module
    Search for the function module by using days in SE37
    Then pass the from and to Date to the function module it will retun the number of days
    update that to table e_T_Range
    You can proceed with this
    Regards
    M.A

Maybe you are looking for

  • How do I accept/reject green/red changes in a FM CMP Compare Document

    I am working in FM 11 and needed to merge one file that two writers worked on at the same time with different sections of that file updated. I used the FM Utility > Compare Documents. The result CMP file showed me the inserted text in bright green an

  • How do I add captions to pictures?

    I am very new to the MAC world (one week to be exact). I have searched help and can find a method to select the font to add captions to photos but cannot find the method. I want add captions to photos in an album and then use the album to create a sl

  • Just purchased Quicktime Pro 7 and cannot find how to get it to work

    I was given a registration code and told to "enter the name and registration code exactly as it appears into the Register pane of the QuickTime preference dialog box" The problem is: I cannot find the registration pane of the quicktime preference dia

  • Column values separated by ,

    Suppose say I have table TAB1 with the following data : COL1 COL2 1 A 1 B 1 C 2 M 2 N 2 O 2 P 2 Q 3 S 3 T How would I retrieve the data in the following format ? 1 A,B,C 2 M,N,O,P,Q 3 S,T

  • [svn] 2169: Add a new proxy adapter for code coverage.

    Revision: 2169 Author: [email protected] Date: 2008-06-20 12:53:04 -0700 (Fri, 20 Jun 2008) Log Message: Add a new proxy adapter for code coverage. Modified Paths: blazeds/branches/3.0.x/qa/apps/qa-regress/WEB-INF/flex/proxy-config.mods.xml