Week function gives wrong result for last week in year

Week(CreateDate(2011,12,25)) returns 51 - correct
Week(CreateDate(2011,12,26)) returns 53 - wrong
It looks like all last weeks of the year are 53 whereas the next year with 53 weeks should be 2015.
See http://tuxgraphics.org/toolbox/calendar.html for example.
I am running CF9 on Windows 7 with Java V6 update 29.
This is causing me a problem. Any ideas for a workaround?
Doug

Here is my general solution for my cfc which seems to work for all dates up to 2100 at least.
Hope it can help if you need a Week function to replace the CF one.
<cffunction name="getISOWeekNum" access="public" returntype="Numeric" hint="Gets ISO week number in which date occurs.">
    <cfargument name="date" type="date" required="true" hint="Date for which you wish to know the week number">
    <cfset var weeknum = 0>
    <cfset var isLeap = isLeapYear(Year(date))>
    <cfset var dayInWeek = dayOfWeek(date)>
    <cfset var isoDayOfWeek = iIf(dayInWeek GT 1, dayInWeek - 1, 7)>
    <cfset var nearestThur = dateAdd("d", 4 - isoDayOfWeek, date)>
    <cfset var fourthDayOfYear = createDate(year(nearestThur), 1, 4)>
    <cfset var fourthDayInWeek = dayOfWeek(fourthDayOfYear)>
    <cfset var fourthIsoDayOfWeek = iif(fourthDayInWeek GT 1, fourthDayInWeek - 1, 7)>
    <cfset var firstThur = dateAdd("d", 4 - fourthIsoDayOfWeek, fourthDayOfYear)>
    <cfset var lastWeek = iIf(fourthDayInWeek EQ 8 OR (isLeap AND fourthDayInWeek EQ 7), 53, 52)>
    <cfset var firstIsoDayOfFirstWeek = dateAdd("d", -(fourthIsoDayOfWeek-1), fourthDayOfYear)>
    <cfset var firstIsoDayOfLastWeek = dateAdd("d", -7, firstIsoDayOfFirstWeek)>
    <cfset var lastIsoDayOfFirstWeek = dateAdd("d", 6, firstIsoDayOfFirstWeek)>
    <cfset var weekDiff = iIf(dateCompare(date, firstIsoDayOfFirstWeek, "d") EQ -1, 0, 1)>
    <cfif dateCompare(date, firstIsoDayOfFirstWeek, "d") EQ -1 AND dateCompare(date, firstIsoDayOfLastWeek, "d") NEQ -1>
        <cfset weeknum = lastWeek>
    <cfelseif dateCompare(date, lastIsoDayOfFirstWeek, "d") NEQ 1 AND dateCompare(date, firstIsoDayOfLastWeek, "d") NEQ -1>
        <cfset weeknum = 1>
    <cfelse>
        <cfset weeknum = weekDiff + (dateDiff("d", firstThur, nearestThur) / 7)>
    </cfif>
    <cfreturn weeknum>
</cffunction>
Doug

Similar Messages

  • Function gives wrong results

    I've calculated it myself and get different results.
    FUNCTION calc_customer_profit (p_custid in number)
    RETURN NUMBER
    IS
    v_days number default 0;
    v_profit number default 0;
    cursor c_profitvalues is
         select ren.customer_id
         ,               ren.rent_dt
         ,               ren.return_dt
         ,               ren.daily_rate
         from rentals ren
         where ren.customer_id = p_custid
         order by ren.customer_id;
    BEGIN
         for r_profitvalues in c_profitvalues loop
              v_days := Days_Between(r_profitvalues.rent_dt, r_profitvalues.return_dt);
              v_profit := (v_days*r_profitvalues.daily_rate)+v_profit;
         end loop;
         return v_profit;
    END calc_customer_profit;

    How about this:
    SQL> create or replace
      2  FUNCTION Days_Between (first_dt IN DATE, second_dt IN DATE := sysdate) RETURN NUMBER
      3  IS
      4  BEGIN
      5    RETURN TO_NUMBER(TO_CHAR(second_dt, 'J')) - TO_NUMBER(TO_CHAR(first_dt , 'J'));
      6  END;
      7  /
    Function created.
    SQL>
    SQL> set null {null}
    SQL>
    SQL> select dt1, dt2, Days_Between(dt1, dt2)
      2  from (
      3  select to_date('24.12.2004', 'DD.MM.YYYY') dt1, to_date('01.01.2005', 'DD.MM.YYYY') dt2 from dual
      4  union all
      5  select to_date('01.01.2005', 'DD.MM.YYYY') dt1, to_date('08.01.2005', 'DD.MM.YYYY') dt2 from dual
      6  union all
      7  select to_date('01.01.2005', 'DD.MM.YYYY') dt1, to_date('01.01.2005', 'DD.MM.YYYY') dt2 from dual
      8  union all
      9  select to_date(NULL, 'DD.MM.YYYY') dt1, to_date('01.01.2005', 'DD.MM.YYYY') dt2 from dual
    10  union all
    11  select to_date('01.01.2005', 'DD.MM.YYYY') dt1, to_date(NULL, 'DD.MM.YYYY') dt2 from dual
    12  );
    DT1       DT2       DAYS_BETWEEN(DT1,DT2)
    24-DEC-04 01-JAN-05                     8
    01-JAN-05 08-JAN-05                     7
    01-JAN-05 01-JAN-05                     0
    {null}    01-JAN-05 {null}
    01-JAN-05 {null}    {null}
    SQL>

  • GetFloatProperty gives wrong result for values out of range

    Hi
    When the method setFloatProperty is called by setting the float values out of the range,then calling getFloatProperty does not give NumberFormatException.
    Float value set more the MAX_VALUE of float returns infinity when getFloatProperty is called.Similar problem occurs with setDoubleProperty.This behavior is confusing.can anyone help me out.
    Regards
    saroj13

    Throwing a NumberFormatException would never make sense in this situation. The exception indicates that you are trying to convert a String to a number, but the String does not contain a valid number. eg. "as3"; when a conversion was attemted would throw a NumberFormatException.
    Floats and Doubles in Java comply with the IEEE 754 standard which mandates the behaviour of the types.
    Could you explain why you find this confusing?
    Hope this helps.

  • Puzzle why query returned wrong value for last record in update.

    Hi all,
    10.2.0.4, Windows 32 bit.
    Apply 15% dis.count to related 5 items ( total amount 522 ) sorted by lowest amount first (amount = 1).
    Last record ( amount = 200 ) will be the total dis.count amount ( 78.3 ) less applied accumulated dis.count amount ( 48.50 ).
    Query runs fine without update clause but wrong result for last record with update.
    CREATE TABLE "T1"
        "ID"       NUMBER NOT NULL ENABLE,
        "ITEM_ID"  VARCHAR2(20 BYTE) NOT NULL ENABLE,
        "AMOUNT"   NUMBER(10,2) NOT NULL ENABLE,
        "dizcount" NUMBER(10,2)
    INSERT INTO T1 ( ID, ITEM_ID, AMOUNT, dizcount )  VALUES ( 65, '101', 1, NULL ) ;
    INSERT INTO T1 ( ID, ITEM_ID, AMOUNT, dizcount )  VALUES ( 65, '102', 1, NULL ) ;
    INSERT INTO T1 ( ID, ITEM_ID, AMOUNT, dizcount )  VALUES ( 65, '201', 200, NULL ) ;
    INSERT INTO T1 ( ID, ITEM_ID, AMOUNT, dizcount )  VALUES ( 65, '215', 155, NULL ) ;
    INSERT INTO T1 ( ID, ITEM_ID, AMOUNT, dizcount )  VALUES ( 65, '111', 165, NULL ) ;
    UPDATE t1 a
    SET a.dizcount =
      (SELECT
        CASE
          WHEN rec_count = row_count
          THEN (78.3 - NVL(lag(temp_total,1) over ( order by rec_count) ,0))-- 78.3 is total dizcount amount from 522 * .15
          ELSE disc_amt
        END amt
      FROM
        (SELECT id,
          item_id,
          disc_amt,
          rec_count,
          row_count,
          CASE
            WHEN rec_count != row_count -- accumulate dizcount amount except for last record
            THEN SUM(disc_amt) over (order by rec_count)
            ELSE 0
          END temp_total
        FROM
          (SELECT ID ,
            item_id,
            amount amt,
            ROUND(amount * .15,1) disc_amt, -- dizcount is 15%
            row_number () over (order by amount) rec_count,
            COUNT ( *) over () row_count
          FROM t1
          WHERE ID = 65
        GROUP BY id,
          item_id,
          disc_amt,
          rec_count,
          row_count
        )b
      WHERE a.item_id = b.item_id
      );Regards
    Zack
    Edited by: Zack.L on Jul 26, 2010 1:26 AM

    Zack.L wrote:
    Query runs fine without update clause but wrong result for last record with update.Not sure why but looks like another case in favour of MERGE.
    MERGE INTO T1
    using (SELECT id, item_id,
        CASE
          WHEN rec_count = row_count
          THEN (78.3 - NVL(lag(temp_total,1) over ( order by rec_count) ,0))-- 78.3 is total dizcount amount from 522 * .15
          ELSE disc_amt
        END amt
      FROM
        (SELECT id,
          item_id,
          disc_amt,
          rec_count,
          row_count,
          CASE
            WHEN rec_count != row_count -- accumulate dizcount amount except for last record
            THEN SUM(disc_amt) over (order by rec_count)
            ELSE 0
          END temp_total
        FROM
          (SELECT ID ,
            item_id,
            amount amt,
            ROUND(amount * .15,1) disc_amt, -- dizcount is 15%
            row_number () over (order by amount) rec_count,
            COUNT ( *) over () row_count
          FROM t1
          WHERE ID = 65
        GROUP BY id,
          item_id,
          disc_amt,
          rec_count,
          row_count
        ))b
    on (t1.id = b.id and t1.item_id = b.item_id)
    when matched then update set dizcount = b.amt ;This worked for me. I tested on 11.2 but should work on 10.2.0.4
    SQL> select * from t1 order by amount ;
            ID ITEM_ID                  AMOUNT   DIZCOUNT
            65 101                           1         .2
            65 102                           1         .2
            65 215                         155       23.3
            65 111                         165       24.8
            65 201                         200       29.8p.s. BTW, not sure if you want the column names in different cases, but your script, as it is, gave me an error (on 11.2)

  • Check condition for last week

    Hi,
    I have a table in which records are stored according to datewise. I want to filter records for last week as per sysdate. For ex, today is thursday and i want to see records which had come in between Monday to Sunday last week.
    Please help me out here.
    Himanshu

    Hi,
    Here is the query to get first day of last week , last day of last week
    SQL>SELECT TO_CHAR((sysdate - to_char(sysdate,'D')),'DAY') LAST_DAY_OF_LW ,
           TO_CHAR((sysdate - to_char(sysdate,'D')) - 6,'DAY') FISRT_DAY_OF_LW,
      2    3         TO_CHAR(sysdate,'DAY') TOday
      4  from dual
      5  /
    LAST_DAY_ FISRT_DAY TODAY
    SATURDAY  SUNDAY    THURSDAY
    1 row selected.Note: Sunday = 1 and Saturday = 7
    Regards

  • Select for update gives wrong results. Is it a bug?

    Hi,
    Select for update gives wrong results. Is it a bug?
    CREATE TABLE TaxIds
    TaxId NUMBER(6) NOT NULL,
    LocationId NUMBER(3) NOT NULL,
    Status NUMBER(1)
    PARTITION BY LIST (LocationId)
    PARTITION P111 VALUES (111),
    PARTITION P222 VALUES (222),
    PARTITION P333 VALUES (333)
    ALTER TABLE TaxIds ADD ( CONSTRAINT PK_TaxIds PRIMARY KEY (TaxId));
    CREATE INDEX NI_TaxIdsStatus ON TaxIds ( NVL(Status,0) ) LOCAL;
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100101, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100102, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100103, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100104, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200101, 222, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200102, 222, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200103, 222, NULL);
    --Session_1 return TAXID=100101
    select TAXID from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_2 waits commit
    select TAXID from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_1
    update TAXIDS set STATUS=1 Where TaxId=100101;
    commit;
    --Session_2 return 100101 opps!?
    --Session_1 return TAXID=100102
    select TAXID, STATUS from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_2 waits commit
    select TAXID, STATUS from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_1
    update TAXIDS set STATUS=1 Where TaxId=100102;
    commit;
    --Session_2 return 100103                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This is a bug. Got to be a bug.
    This should be nothing to do with indeterminate results from ROWNUM, and nothing to do with read consistency at the point of statement start time in session2., surely.
    Session 2 should never return 100101 once the lock from session 1 is released.
    The SELECT FOR UPDATE should restart and 100101 should not be selected as it does not meet the criteria of the select.
    A statement restart should ensure this.
    A number of demos highlight this.
    Firstly, recall the original observation in the original test case.
    Setup
    SQL> DROP TABLE taxids;
    Table dropped.
    SQL> 
    SQL> CREATE TABLE TaxIds
      2  (TaxId NUMBER(6) NOT NULL,
      3   LocationId NUMBER(3) NOT NULL,
      4   Status NUMBER(1))
      5  PARTITION BY LIST (LocationId)
      6  (PARTITION P111 VALUES (111),
      7   PARTITION P222 VALUES (222),
      8   PARTITION P333 VALUES (333));
    Table created.
    SQL>
    SQL> ALTER TABLE TaxIds ADD ( CONSTRAINT PK_TaxIds PRIMARY KEY (TaxId));
    Table altered.
    SQL>
    SQL> CREATE INDEX NI_TaxIdsStatus ON TaxIds ( NVL(Status,0) ) LOCAL;
    Index created.
    SQL>
    SQL>
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100101, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100102, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100103, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100104, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200101, 222, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200102, 222, NULL);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> Original observation:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> Session 2 with same statement hangs until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> At which point, Session 2 returns
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session2>There's no way that session 2 should have returned 100101. That is the point of FOR UPDATE. It completely reintroduces the lost UPDATE scenario.
    Secondly, what happens if we drop the index.
    Let's reset the data and drop the index:
    Session1>UPDATE taxids SET status=0 where taxid=100101;
    1 row updated.
    Session1>commit;
    Commit complete.
    Session1>drop index NI_TaxIdsStatus;
    Index dropped.
    Session1>Then try again:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> Session 2 hangs again until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> At which point in session 2:
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100102
    Session2>Proves nothing, Non-deterministic ROWNUM you say.
    Then let's reset, recreate the index and explicity ask then for row 100101.
    It should give the same result as the ROWNUM query without any doubts over the ROWNUM, etc.
    If the original behaviour was correct, session 2 should also be able to get 100101:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    taxid         = 100101
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> same statement hangs in session 2 until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> so session 2 stops being blocked and:
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    taxid         = 100101
      6  FOR UPDATE;
    no rows selected
    Session2>Of course, this is how it should happen, surely?
    Just to double check, let's reintroduce ROWNUM but force the order by to show it's not about read consistency at the start of the statement - restart should prevent it.
    (reset, then)
    Session1> select t.taxid
      2   from
      3    (select taxid, rowid rd
      4      from   taxids
      5      where  locationid = 111
      6      and    nvl(status,0) = 0
      7      order by taxid) x
      8   ,  taxids t
      9   where t.rowid = x.rd
    10   and   rownum = 1
    11   for update of t.status;
         TAXID
        100101
    Session1>
    --> Yes, session 2 hangs until...
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> and then
    Session2> select t.taxid
      2   from
      3    (select taxid, rowid rd
      4      from   taxids
      5      where  locationid = 111
      6      and    nvl(status,0) = 0
      7      order by taxid) x
      8   ,  taxids t
      9   where t.rowid = x.rd
    10   and   rownum = 1
    11   for update of t.status;
         TAXID
        100102
    Session2>Session 2 should never be allowed to get 100101 once the lock is released.
    This is a bug.
    The worrying thing is that I can reproduce in 9.2.0.8 and 11.2.0.2.

  • 0CRM_OPPT_H  (Transaction RSA3 gives wrong result)

    Hi gurus,
    <b>0CRM_OPPT_H  (Transaction RSA3 gives wrong result)
    BBPCRM 4.0
    BW 3.50 version</b>
    I had enhanced the structure "crmt_bw_oppt_h"
    and also written a BADI to populate Opportunity header status.
    But when I run extract checker RSA3 for CRM data,
    I get wrong number of records.
    I am having 95 records for Opportunities header data.
    Data Records / Call = "100"
    Display Extr. Calls = "10"
    Above settings, I am retrieving only 61 records.
    <b>Data Records / Call = "1"
    Display Extr. Calls = "200"
    For the above settings in RSA3,
    I am able to retrieve 95 records correctly.</b>
    The problem is that in RSA1 transaction of BW 3.50 server also,
    61 records are being loaded from CRM server.
    <b>Could this be a Cache memory problem,
    Are any of my BASIS settings a cause for this problem?</b>
    Any help is really appreciated and will be rewarded.
    Thanks,
    Aby Jacob
    ========

    Dear Friends,
    <b>I had to do a small correction in my BADI code.
    I got a solution from Online SAP HELP portal.</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf4940e11d295df0000e82de14a/frameset.htm
    Notes on BADI Usage
    ====================
    The instance generated through the factory method should be declared
    as globally as possible or generally be passed as a parameter
    to ensure that the initialization process must be run as rarely as possible
    – just once would be best. In no case should you discard the instance as soon as
    it is generated or repeatedly run the initialization process in a loop.
    Within the adapter class interface,
    required database accesses are buffered locally,
    so that each access is executed once only.
    However, repeated initialization makes
    the buffer useless and dramatically reduces performance.
    Due to the local buffering, you can call Business-Add-In methods
    without having to expect considerable performance restrictions,
    even if no active implementations exist.
    Also, if the definition of the Business-Add-In is filter-dependent,
    a single instance is sufficient.
    However, you should not do without initialization altogether.
    Even if you could call static methods of the implementing
    class of the Business-Add-In implementation without an instance,
    you would lose the benefit of performance improvement through
    the Business-Add-Ins and the possibility of multiple use.
    If you switch the method type in the interface from the static method
    to the instance method at any time in the future,
    many code adjustments are required.
    In addition, you can no longer use default code that is provided.
    <b>Many Thanks to ROBIN
    and the whole SDN team</b>
    Aby Jacob ,,,,,

  • Content Search Web Part displaying wrong Results for anonymous Users.

    HI Forum Group,
    I am getting Wrong results for my content search web part. The requirement is to show the News Description for the selected news item.
    I have a catalog site which stores News like 
    News1
    News2
    News3
    as Items. and i have connected this catalog in publishing site which is anonymous. In the publishing site created one page "News.aspx"added search results webpart which shows all the news item. Added one page "Description.aspx" to show
    description to show the selected news item.
    When ever user selects any news from news.aspx page it will redirected to description.aspx with the selected item ID
    The "Description.aspx" the search results page gets the data based on the URL by QueryString parameter as shown below
    The problem is, if i multiple items to open in tabs all the items are showing the data same as the first selected item, though the article ID is different.
    Thanks
    Sithender

    Hi,
    Thank you for your feedback on how you were successful in resolving this issue.
    Your solution will benefit many other users, and we really value having you as a Microsoft customer.
    Have a nice day!
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • CALCULATE_TAX_ITEM gives wrong values for Scess and HScess in PO Print

    Dear Friends,
    I am working with PO Print in smartforms hare the Fm CALCULATE_TAX_ITEM is gives wrong values for Scess and HEcess if I put the Gate pass (Basic Excise Duty) Manually.
    And one more Issue is as if I check any line item condition taxes than imediatly when I see the print the all line items Scee and HEcess displays same which I have saw.
    If there is a single line item in PO than there is no issue any way.
    kindly suggest to resolve the issue.
    Regards,
    D Tarun Kumar

    Hi,
    I had the same issue, that taxes on invoice tab of PO was not printed correctly on PO form by calling CALCULATE_TAX_ITEM.
    If you want to have the same tax value as komp-mwsbp, that use following form routine call before FB CALCULATE_TAX_ITEM.
    perform j_1b_save_tax_fields(saplmepo) using ekko ekpo lfa1.
    This is used in transaction me23n also.
    Kind regards,
    Tülay

  • Connected Ips or host name for last week

    Hi
    How can we find the IPs connected to apps for last 1 week,Whether error_log or access_log will give any picture
    rgds
    shrey

    On a regular basis I use the access_logs to see which ips access the ebusiness suite. Haven't really used the error_logs much unless I'm trying to debug a problem.

  • Disconnected ever few minutes for last week

    My dsl has been unusable for the last week.  every few minutes I am disconnected.  Sometimes it reconnects, other time I have to unplug the router and modem to reset.  I have had Verzon dsl for several years with mixed results but this is insane.  I may have reached the breaking point, Comcast may be my next cal...

    Since you have your own router, you may want to follow the info at http://www.dslreports.com/faq/13600
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.

  • Parameter for Last Week, Last Month & Last Year from the current Date

    I have a crystal report that has a StartDate & EndDate parameters from the stored procedure that I am calling. Now i got a new requirement saying that my user wants a drop-down parameter in which they need to be able to select last week (Sunday to Saturday), last month, last year instead of manually selecting start date and end date parameters? Can anyone please explain me how to do this?
    (FYI, I am using Crystal 2008)

    Hi Naveen,
    You'll need to handle the logic in the Stored Proc's where clause.
    If you're using oracle, I have something like this in the Stored Proc's where clause for our reports:
    Where {Date_Field} Between
    Decode('{?Relative Date}',
    'Yesterday', sysdate - 1,
    'Last Week', Tunc(sysdate, 'IW')-7)
    AND
    Decode('{?Relative Date}',
    'Yesterday', sysdate,
    'Last Week', Tunc(sysdate, 'IW'))
    where 'Relative Date' is a prompt in the Stored Proc and 'yesterday'. 'last week' are the 'static values' in the prompt.
    -Abhilash

  • Logged users for last week or last  7 days

    Hi in my application there is log for who is logging and i want to find who logged for last 7 days or last week.i tried the following query and its not workinghow to fix it
    select uid,agentid ,logtime from agnt_mst
    to_date(to_char(logtime,'dd-mm'),'dd-mm') between to_date(to_char(sysdate,'dd-mm'),'dd-mm') and to_date(to_char(sysdate,'dd-mm'),'dd-mm') - 7;

    Here trying for one test table
    desc emp_benefit
    employee_number varchar2(30)
    employee_name varchr2(40)
    dob date
    select distinct employee_number,dob from emp_benefits
    WHERE trunc(dob) >= trunc(sysdate-5)
    it shoud return
    70935     Mrs. Mervatte      17-AUG
    74552     Mrs. Dona      18-AUG
    75331     Mrs. Ramesh     20-AUG
    76068     Mr. Fernandes     17-AUG
    72366     Ms. Rajaa      19-AUG
    rgds
    raj

  • Calculate Dates for Last week and next three weeks

    Hi,
    I have a report where I need to calculate dates between last week and the next three weeks (not counting current week). I'm familar with the first part, it could be done by using the LastFullweek function but not sure how I can avoid the current week and calculate the next three weeks.
    Any help is greatly appreciated.
    Thanks!

    ... and here are a few more...
    Last Week...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
    THEN TRUE ELSE FALSE
    The week before...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
    THEN TRUE ELSE FALSE
    And the week before that...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
    THEN TRUE ELSE FALSE
    and of course all 3 weeks together...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
    THEN TRUE ELSE FALSE
    If you want the 1st day of the week to be Monday instead of Sunday just change the date of #1/7/190# to #1/1/1900#
    HTH,
    Jason

  • Why does the Fireworks save for web function give better results than in Photoshop?

    Having used the trial version of Fireworks, I have noticed that the save for web function gives greater compression and image quality than saving for web in Photoshop. Why is this?
    As Adobe are not continuing in developing Fireworks, does anyone know if will they will improve the save for web function in Photoshop to match the Fireworks version?
    Are there any third party companies who anyone can recommend who will process large volumes of images for web?
    Thanks

    One of my favourite topics ;-P
    First, the save for web function in Photoshop has not seen any real updates in a long time. In Fireworks PNG export allows for fully transparent optimized files with indexed 256 or less colours, which is impossible in the save for web function in Photohop. It is unsupported.
    This is one of the reasons why Fireworks does a much better job than Photoshop. Another reason is that Photoshop adds meta junk in its exported files, and this also increases the file size (and should be removed, because there are also a number of fields which include information about your setup).
    One other caveat is that Photoshop's save for web functions neither allows for a choice in chroma subsampling, and instead decides automatically below a certain quality threshold to degrade the colour sharpness quality. The user has no control over this. (Fireworks also limits the user this way.)
    One thing to be careful of: FW's jpg quality setting, and PS's quality settings are very different - a 50 in Photoshop is not the same 50 setting in Fireworks.
    For jpg optimization I generally use RIOT (free): http://luci.criosweb.ro/riot/
    (When you install, be careful NOT to install the extra junkware!)
    Fireworks cannot change the chroma subsampling to 4:2:0, which does degrade the quality a bit compared to RIOT and Photoshop in my experience. Photoshop adds useless meta information, even if the user tells it not to do that. RIOT allows you to remove that information, saving 6k. RIOT also offers an automatic mode that optimizes existing jpg images without degrading the quality further, and often saves 10k or more, depending on the images.
    Interestingly enough, in my tests exported Fireworks jpg images are always reduced in file size by RIOT, due to FW's jpg export limitations, without any image degradation.
    In my tests FW's jpg quality versus file size turns out to be the worst of all three. RIOT generally wins, or is at least on par with Photoshop.
    As for PNG export, Photoshop's save for web function is quite abysmal. No 256 colour full transparency export is possible, while Fireworks does support this.
    Having said that, there is a free alternative that leaves both Photoshop AND Fireworks in the dust: Color Quantizer. http://x128.ho.ua/color-quantizer.html
    CQ is an amazing little tool: with it anyone can create PNG files with full transparency and reduced to ANY number of colours! It means that a 512 colour PNG with full transparency is now very easy to do. On top of that, for more difficult images a simple quality mask brush tool allows the user to control and retain even small colour details in a PNG, while reducing the file size to an absolute minimum.
    CQ is one of the best kept secrets of a Web Developer's toolkit. And it is free!
    Both RIOT and Color Quantizer have a built-in batch mode. Both are available for WIndows. Not for Mac. If you are on a Mac, try imageOptim. Not nearly as good as RIOT and CQ, but quite passable.
    PS to be fair, the newest versions of Photoshop do allow for export of 8bit PNGs with full transparency through the use of its Generator functionality. But again, it cannot compete with CQ. And as far as I am aware, Generator cannot be used in Photoshop's batch processing (which, btw, is very slow! For simpler daily image processing tasks I have to do in batches, I prefer IrfanView, which is lightning fast! IrfanView).

Maybe you are looking for

  • Help on SQL Script

    Hi All, I'm using Oracle 9.2. I have a scenario where my table has 2000+ rows, and I have to swap values of rows 3 to 36 upside down and rest of the rows remains unchanged. Therefore I need your expertise advise to do this. Any scripts would be helpf

  • Create Employee as Buyer

    Hi- I need to create an employee as a buyer in Oracle through a backend interface. I assumed this would be simple as it only requires adding a entry in the PO_AGENTS table, correct? If this is the case, I was looking for an API and found none. So I u

  • This page can't be displayed because your computer is currently offline - Wifi is connected, but cannot connect to the internet! :/

    "This page can't be displayed because your computer is currently offline" - what exactly does that mean? I've gone through and repaired by hard drive, and there didn't seem to be a problem there. I've manually entered in an IP address several times..

  • How can I adjust size of default action frames

    Hi, How can I adjust size of default action frames they are very thin.  I have tried double clicking on that part I think it is in the actions but can only adjust the drop shadows etc not the actual size of the frame ie like in the wooden frame. hop

  • What's the problems????????

    Hello, I have an application written by Visual basic 6.0 and running in SQLserver 2000. i prepare for migration to Oracle database 8.1.6. what's the problems of my application when i migrate from SQLserver to Oracle? Help me please? Thanks! Chuyen.