Calculate with datas

Hi NG,
why is it not working???
I try to calculate with a spy (xml) data. The column type is set as number.
I calculate with the following php code (simple..code):
$ps = "{price}";
$ps = $ps/2;
echo $ps;
Its all the time 0
If i try:
$ps = "{price}";
//$ps = $ps/2;
echo $ps;
i get the right numbers....but i will calculate them.
i tryed  also:
$ps = "{price}";
$ps = (int)$ps;
$ps = $ps/2;
echo $ps;
Whats my mistake????
Or is there any other way to calculate the output???
TELLO

OMG - perfect. I will round them now and than its perfect.
.V1 - one mor Question...
Yesterday after your replay i realised, that i can not work with the spry ds and php together. Its a desaster for me now, because all my ideas are using booth ;-)
My main problem is now, i have one externel XML, whate i can only get over a external ASP website. I get it only with the proxy trick.
Now i make a "user they see this car, have seen also this one" ....i will build for this a mySQL db, witch i will fill / update per session....
But now, i can not input them with php, because i dont can work with the spry ds ....
Do you have any idea, how i can input the id´s in my mySQL?
Or must i send the spry ID´s as array to a php and this will input them in the background?
Is there no easyer thing?
THank you so mutch for you help all the time!!!
TELLO

Similar Messages

  • Calculate with dates

    Hello,
    I want to calculate with two dates.
    The first date is the current date. The second one is a date in the future. In a third field it should be calculated the amount of days during these two dates. (in consideration of leap year = Schaltjahr...)
    For instance:
    First field/date: Today it is the 23.06.2010
    Second field/date: The date in the future is the 25.06.2010
    Third field: (2/) 3 (days)
    code?: event.value=((AFMakeNumber(this.getField("dateInTheFuture").value)-(this.getField("curren tDate").value)))
    Can anybody help me?
    Thank you in advance!

    Hello try67,
    nice to "see" you again. (Last week you help us with a comb-box problem).
    At first thank you for helping us.
    No, now I want to use Acrobat forms. (But we also often need help in LC programmation. Are you good in it?)
    Sorry, it doesn't work. Invalid date/time: please ensure that the date/time exists. Field [Text3] should match format dd.mm.yyyy. But [Text3] has this format.
    What does util.scand mean?
    Thanks in advance

  • UCCX 8 Calculate a date

    Hello there,
    i don't know if it is really possible. But i was looking for the moveable holiday solution. I read always about the holiday script, that has a XML file as base for the holiday dates. But i want to calculate them on my own. I don't want the customer to change always the XML file.
    In germany we have a couple of holiday dates that are not fixed every year (like easter). It is not really nice to edit the XML file every year for the new dates. Someone of you will say: "Put the holidays for the next 10-30 years into the script!".
    Yes that can i do, but i will automate this
    So my question, has anyone tried something like that? I'm at the point that i don't know how to calculate with dates. Here a example:
    To calculate the next holiday, i have the easter sunday date calculated. Like 2011/24/04.
    The next holiday is 49 days in the future. So i have to add 49 days to the date of easter. I hope you see my problem. How can i calculate this to be aware of the month.
    Has anyone a idea? All posts are welcome!!!
    Christian

    Hi Koen,
    for the Easter, i googled a little bit around and found a couple of formulas to calculate the Easter Sunday. Here is the calculation:
        Given is year
        int c;
        int i;
        int j;
        int k;
        int l;
        int n;
        int EasterDay;
        int EasterMonth;
        string EasterDate;
        c = year / 100;
        n = year - 19 * ((int)(year / 19));
        k = (c - 17) / 25;
        i = c - c / 4 - ((int)(c - k) / 3) + 19 * n + 15;
        i = i - 30 * ((int)(i / 30));
        i = i - (i / 28) * ((int)(1 - (i / 28)) * ((int)(29 / (i + 1))) * ((int)(21 - n) / 11));
        j = year + ((int)year / 4) + i + 2 - c + ((int)c / 4);
        j = j - 7 * ((int)(j / 7));
        l = i - j;
        EasterMonth = 3 + ((int)(l + 40) / 44);
        EasterDay = l + 28 - 31 * ((int)OsterMonat / 4);
        EasterDate = EasterDay + "." + EasterMonth + "." year
    This calculation did i in some SET Steps. Then i put the EasterDate in a Variable String. Works perfect.
    But the calculation of the movable holidays is more complex as i thought. So as you say, i try to do this in Java. But i did not know anything about Java (
    I will try to understand you example and work on this to do what i will ))
    Greets
    Christian

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • Tolerance Limits with Date and quantity

    Hi Experts,
    We would like to set the GR Tolerance Limits with Date and qty.
    how to set the Tolerance Limits for Date and quantity..??
    if we created PO 100qty and date 01-05-009.
    if we receive the goods on 20-04-2009 and 50qty...
    For GR .. Migo should be give error message..
    where can i set this Tolerance Limit Configuration.... can u please explin me..
    Thanks in Advance,
    Anthyodaya .

    Go to SPRO - Material Managemetn - LIV - Invoice Block - Set Tolerence limit.
    USe company code and maintain a value for ST
    ST: Date variance (value x days)
    The system calculates for each item the product of amount * (scheduled delivery date - date invoice entered) and compares this product with the absolute upper limit defined. This allows relatively high schedule variances for invoice items for small amounts, but only small schedule variances for invoice items for large amounts.

  • APD with date variable in filter object

    Have an APD with a filter object. The filter uses a range for 0CALDAY. the range includes a variable (customer_exit) whic calculates the date of previous fiscal period-end date. Works perfectly in Bex.
    However, when running the APD, the date format comes out as YYYY/MM/DD, and 0CALDAY is expecting MM/DD/YYYY.
    How can I get the internal format of the date correct? I get no errors in the APD, however the date format causes incorrect results, as if no date was entered.
    Any suggestions?
    PS. actually, the internal date format used by the APD for my variable ZCE_PREVPER_END is:
    ZCE_PREVPER_END  = '20101001'
    Needs to be 10/01/2010....
    Edited by: JoeC on Oct 27, 2010 11:39 PM

    Hi Jordan,
    I would suggest several options.
    First, you have the option within Webi to display only the date and not the time (right click on the object on the report, or go to field properties, and change the format of the display).
    If you are using this value in comparisons in the report, you must make sure the format matches. Try changing the format within the variable to be the same as what you are comparing it to. If that is still not working, let me know. It may still just be a syntax or data type/format error.
    Thanks

  • How to calculate start date of the week based on week number ?

    i need to get week number of the current date and based on that i need to calculate start date falling in the same week for last year.
    Eg. today is 31st week of year and 31st july date. so what will be the date on the 31st week of last year. i need the start date of that week.
    we can calculate the week number by select to_char(sysdate,'ww') from dual.
    DO we have a single line query for that or will it require writing a pl/sql block ?

    you can try following query
    it can be as inline but for more clean look and create it as select with include select
    with t as
    (select sysdate as dt from dual)
    select to_char(prev_year_dt - to_char(prev_year_dt, 'D') + 1, 'DD.MM.YYYY') as start_of_week from (select
    -- get day from prev year with the same week number
        case
               when to_number(to_char(add_months(dt, -12), 'WW')) > to_number(to_char(dt, 'WW')) then
                dt - (to_number(to_char(add_months(dt, -12), 'WW')) - to_number(to_char(dt, 'WW'))) * 7
               when to_number(to_char(add_months(dt, -12), 'WW')) < to_number(to_char(dt, 'WW')) then
                dt + (to_number(to_char(dt, 'WW')) - to_number(to_char(add_months(dt, -12), 'WW'))) * 7
               else
                add_months(dt, -12)
           end as prev_year_dt
      from t) t1good luck
    Sergii
    'Monday' is not first day of week in 100% ;)
    Edited by: Galbarad on Jul 30, 2012 11:00 PM

  • Calculate due date

    Hello guys:
    I need your help here.
    I try to build an application that has to calculate the due date for 14 days.
    I have two date picker:
    1)P11_BORROW_DATE
    2)P11_RETURN_DATE
    How can i calculate the borrow date plus 14days to become the return date shown in the in the second date picker.
    I am using date format of (DD-MM-YYYY).
    Can u guys explain to me step by step, for example : (html form header region, process, and also htnl attiributes, etc )
    Edited by: user10258545 on 14-Sep-2008 10:57

    hello
    >> It can calculate the date after i press a button. It cannot calculate automatically when i change the borrow date in my application.
    In his example, Denes is using AJAX. You can read more about AJAX with APEX in here - http://htmldb.oracle.com/pls/otn/f?p=11933:63 . This page should answer most of your questions.
    I’m not sure why you think you must press a button in order to fire the AJAX code. You have complete control on the firing timing, by using the appropriate event. Using ‘onchange’ or ‘onblur’ will fire the AJAX code without pressing any button.
    >> Btw, where should i load the process??
    The processes involved with APEX are Application Processes with process point of “On Demand …”. They are been loaded on demand, by part of the AJAX process.
    Regards,
    Arie.

  • MDX Filter with date range

    Hi,
    my requirement is to create a calculated member to calculate Total unique customers who has sales > 0 within the date range.
    Below mdx works normally with single date
    DistinctCount(FILTER([Customer_Sales].[Outlet ID].[Outlet ID].members,
    ([Measures].[distribution],
    [Date].[CalendarWeek].CurrentMember
    )=1))
    I'm looking for something like below with date range,
    DistinctCount(FILTER([Customer_Sales].[Outlet ID].[Outlet ID].members,
    ([Measures].[distribution],
    WTD([Date].[CalendarWeek].CurrentMember
    ))=1))
    Above MDX fails with the error: String of numeric expression expected, Tuple set expression was used.
    Appreciate your immediate response.
    Thanks in advance

    Hi Chandima,
    Thanks for the response.
    I tried your code, it works but the results are not correct.  As per manual calculations, there are 28 unique customers who has positive sales on Week to date (2014-11-03), but result shows only 19.
    For the first day of week (2014-11-01), there are 9 unique customers, which is correct. But for the following days it is not giving correct result.
    Further, performance of this approach is very poor
    Thanks,

  • Working with dates

    hello,
    I am working with dates. It looks like so:
    1st I want to calculate a time span for example calculate cell A2 - cell A1. In cell A1 it is written 01.01.2010 (so first of January) and in cell A2 01.02.2010 (so first of February). I wrote the dates in letters, too, to avoid misunderstandings due to different national date formats.
    Since January has 31 days, the obvious result thereof is "31D". So far so good.
    but now I want to multiply the 31 with a numeric value, but not the 31D, because if I do so, and let's say the numeric value is 3, then my result is 93 DAYS rather than just 93.
    So my question is, is there any possibility how I can further calculate with a result coming from date calculations without having the new result also in the date format? Anything that escapes the "DAYS" in further calculations??
    Thx

    mac-a-rooney wrote:
    I am working with dates.
    1st I want to calculate a time span for example calculate cell A2 - cell A1. In cell A1 it is written 01.01.2010 (so first of January) and in cell A2 01.02.2010 (so first of February). I wrote the dates in letters, too, to avoid misunderstandings due to different national date formats.
    Since January has 31 days, the obvious result thereof is "31D". So far so good.
    but now I want to multiply the 31 with a numeric value, but not the 31D, because if I do so, and let's say the numeric value is 3, then my result is 93 DAYS rather than just 93.
    Are you sure you're asking in the right forum?
    Using Numbers '08, with the following entries:
    B2: Jan 1, 2010
    C2: Feb 1,2010
    D2: =C2-B2
    E2: =3*D2
    I get 31 (not 31D) in D2 and 93 (not 93 DAYS) in D2.
    From your description, I think you're actually using Numbers '09, and Jerry's advice above applies.
    Regards,
    Barry

  • Using Numbers, can I calculate the date that will be eg 45 days ahead of a given date?

    Using Numbers, can I calculate the date that will be eg 45 days ahead of a given date?

    MWB,
    Certainly. Let's say that your given date is in B2. The date 45 days earlier can be found with:
    =B2 – 45.
    Almost seems too simple.
    Jerry

  • "D2008178" - FM to calculate the date of the x day in a year

    Hi all!
    I am looking for a FM to calculate the date of a certain day in the year.
    For example which date has the day 178 of the year.
    This has nothing to do with the factory calendar!!!
    Thanks a lot for your help
    CU
    Peter

    Hi Peter,
    Please check this funtion module "FIMA_DATE_CREATE".
    Sample code as follows:
    REPORT  ztest_vinay.
    DATA: w_date TYPE vtbbewe-dvalut.
    PARAMETERS: p_date TYPE vtbbewe-dvalut.
    CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        i_date                        = p_date  " Here you need to pass first day of the year
        i_calendar_days         = 178
    IMPORTING
        e_date                        = w_date.
    WRITE: w_date.
    Regards,
    Vinay
    Edited by: Vinay Kumar Amruth on Feb 18, 2009 2:52 PM
    Edited by: Vinay Kumar Amruth on Feb 18, 2009 3:01 PM

  • *Urgent* Query with dates

    Hi Gurus,
    I am having problem in developing such a query which has calculations with dates. The problem is:
    I have
    base date for example 26-feb-2006
    statring day: 4
    interval: 5
    input date: 15-mar-2006
    Now the problem is I want to get the results from the query which will start 26-feb-2006+4 which is 02-mar-2006 and calculate the interval which is 5 days from '02-mar-2006' and run it every 5 (interval) days
    02-mar-2006
    07-mar-2006
    12-mar-2006
    I hope I have cleared everything.
    Please let me know as soon as possible.
    Thanks in advance.
    Aqil

    Where is the base_date coming from?
    declare
    v_jobno number;
    dbms_job.submit(v_jobno, 'SCHEMA_NAME.sp_my_proc();',
    -- first time running I schedule for 11 pm staring in 4 days
                              trunc(sysdate+4)+23/24,
    -- here the interval
                              'trunc(sysdate+5)+23/24' );
    end;

  • Working with Date

    Hi:
    I need to calculate 30 days usage from activation date. I've a table as below:
    ACTIVATION
    USER
    USAGE
    USAGE_DATE
    5/8/2013
    ROB
    20
    7/8/2013
    6/8/2013
    HANS
    50
    7/8/2013
    6/8/2013
    MIKE
    0
    7/8/2013
    5/8/2013
    PIETER
    30
    7/8/2013
    5/8/2013
    ROB
    90
    9/8/2013
    6/8/2013
    HANS
    55
    11/8/2013
    5/8/2013
    ROB
    70
    13/8/2013
    I've to start with activation date, suppose for ROB the activation date is 5-August-2013. Now it's required to calculate all the usage from 05-AUG-2013 to 03-SEP-2013. There are total 3 USAGE_DATE found for ROB with the 30 days boundary. So, the output will be 180. The end date can be found using USAGE_DATE column.
    Output:
    ACTIVATION
    USER
    TOTAL_USAGE
    5/8/2013
    ROB
    180
    6/8/2013
    HANS
    105
    6/8/2013
    MIKE
    0
    5/8/2013
    PIETER
    30
    Please help me with code.
    Thanks/Tanvir

    Something like this!!
    with data as
    select to_date('5/8/2013','dd/mm/yyyy') activation, 'ROB' user_name, 20 usage, to_date('7/8/2013 ','dd/mm/yyyy') usage_date from dual union all
    select to_date('6/8/2013','dd/mm/yyyy') activation, 'HANS' user_name, 50 usage, to_date('7/8/2013 ','dd/mm/yyyy') usage_date from dual union all
    select to_date('6/8/2013','dd/mm/yyyy') activation, 'MIKE' user_name, 0 usage, to_date('7/8/2013 ','dd/mm/yyyy') usage_date from dual union all
    select to_date('5/8/2013','dd/mm/yyyy') activation, 'PIETER' user_name, 30 usage, to_date('7/8/2013 ','dd/mm/yyyy') usage_date from dual union all
    select to_date('5/8/2013','dd/mm/yyyy') activation, 'ROB' user_name, 90 usage, to_date('9/8/2013 ','dd/mm/yyyy') usage_date from dual union all
    select to_date('6/8/2013','dd/mm/yyyy') activation, 'HANS' user_name, 55 usage, to_date('11/8/2013 ','dd/mm/yyyy') usage_date from dual union all
    select to_date('5/8/2013','dd/mm/yyyy') activation, 'ROB' user_name, 70 usage, to_date('13/8/2013 ','dd/mm/yyyy') usage_date from dual
    select distinct activation,
    user_name,
    sum(usage) over(partition by user_name) total_usage
    from data
    where activation between to_date('5/8/2013','dd/mm/yyyy') and to_date('3/9/2013','dd/mm/yyyy')
    and usage_date is not null
    OP:-
    ACTIVATION  USER_NAME  TOTAL_USAGE
    8/5/2013       ROB       180
    8/5/2013       PIETER     30
    8/6/2013       MIKE        0
    8/6/2013       HANS      105

  • Help with date calculation based on office hours

    Hi,
    could you guys point me which way should I think of in PL/SQL, or maybe SQL to calculate a date using not 24 hours day, but office hours.
    Let me give you an example
    Office hours are between 9am till 5pm
    I receive a case - registration time - 14.03.2013 4pm, and I'm supposed to calculate the Due date, let's say Registration time + 10hours.
    Normaly I would do "registration time" + 10hours, but I can't. I cannot use 24 hours window for the calculation, but 9am - 5pm window.
    So the "Due timestamp" would be = "16.3.2013 10am". Which is : 1 hour from 14.03. + 8hours from 15.3. + 1 hour from 16.3.
    Thanks for any ideas.

    Hi,
    A user-defined function would be very handy for that. Foir example
    add_office_hours ( in_start_date DATE
                     , in_num_hours  NUMBER
    RETURN DATE
    DETERMINISTIC ...First, copy in_start_date to a local variable, start_date, and check if start_date is within office hours. If not, change it to the beginning of the next business day.
    Add in_num_hours to start_date. Is the result before 5pm on the same day?
    If so, the function is finished. Return that date.
    If not, find how much past 5pm the result is, and recurse (that is, have the function call itself with a new, later in_start_date and a new, smaller in_num_hours). If you prefer, you can use a loop instead of recursion.
    How do you treat weekend and holidays?
    Would you want to call the function with a negative number of hours?
    If you'd like help. post your best attempt.
    Post CREATE TABLE and INSERT statements for a table that you use for testing. The table should have start_date, num_hours and correct_result_date columns.
    Always say which version of Oracle you're using (e.g. 11.2.0.3.0).
    See the forum FAQ {message:id=9360002}

Maybe you are looking for