How to find first and last day of last month?.

Hello,
I am using Crystal Report XI.
Reports will be generated on first of every month for
previous month. I want to find start and end date of previous month
dynamic.
For august, Start date is July 1st and End date July 31st.
For September, start date is Aug 1st and Aug 31st.
How can i get first of previous month as start date and last
day of the previous month as end date?.
Same kind of thing I want to do for future report ..find next
month start date and end date.
Thanks

Adomacro,
you could do a function, like this
<cffunction name="getReportdates" returntype="struct"
hint="Given an arbitrary month and year, the function returns a
structure containing the first and last day of the previous
month">
<!--- Take current month and current year as the default
--->
<cfargument name="mnth" type="string" required="No"
default="#monthAsString(month(now()))#">
<cfargument name="yr" type="numeric" required="No"
default="#year(now())#">
<cfset firstDayOfGivenMonth = parseDateTime("1 " &
arguments.mnth & " #arguments.yr#")>
<cfset lastDayOfPreviousMonth =
dateAdd("d",-1,firstDayOfGivenMonth)>
<cfset numberOfDaysOfPreviousMonth =
daysInMonth(lastDayOfPreviousMonth)>
<cfset firstDayOfPreviousMonth =
dateAdd("d",-#numberOfDaysOfPreviousMonth#,firstDayOfGivenMonth)>
<cfset reportDates = structNew()>
<cfset reportDates.firstDayOfPreviousMonth =
firstDayOfPreviousMonth>
<cfset reportDates.lastDayOfPreviousMonth =
lastDayOfPreviousMonth>
<cfreturn reportDates>
</cffunction>
<!--- Example usage --->
<p>
Given month: <strong>March
2004</strong><br>
begin date:
<cfoutput>#dateFormat(getReportdates('March',2004).firstDayOfPreviousMonth,"d
mmm yyyy")#</cfoutput><br>
end date:
<cfoutput>#dateFormat(getReportdates('March',2004).lastDayOfPreviousMonth,"d
mmm yyyy")#</cfoutput><br>
</p>
<p>
Given month: <strong>August
2007</strong><br>
begin date:
<cfoutput>#dateFormat(getReportdates('August',2007).firstDayOfPreviousMonth,"d
mmm yyyy")#</cfoutput><br>
end date:
<cfoutput>#dateFormat(getReportdates('August',2007).lastDayOfPreviousMonth,"d
mmm yyyy")#</cfoutput><br>
</p>

Similar Messages

  • How to find first and last day of previous month?.

    Based on current month, I want to find start and end day of
    previous month.
    For example,
    For august, Start date is July 1st and End date July 31st.
    How can i get first of previous month as start date and last
    day of the previous month as end date?.
    Same way,
    i want to find start date of current month and end date of
    next month.
    Example:
    For august,
    i want to get start date, august 1st and end date : september
    30.
    How can i do this from current date or now().
    I am looking for best and easy way to find start and end
    dates..
    Thanks

    <cfset today = now()>
    <cfset firstOfThisMonth = createDate(year(today),
    month(today), 1)>
    <cfset lastOfNextMonth = dateAdd("d", -1, dateAdd("m", 2,
    firstOfThisMonth))>
    <cfoutput>
    today = #today#<br>
    firstOfThisMonth = #firstOfThisMonth#<br>
    lastOfNextMonth = #lastOfNextMonth#<br>
    </cfoutput>
    Edit - To find the start and end day of previous month, get
    the first of THIS month. Use Subtract 1 month ("m") to get the
    start date. Subtract 1 day ("d") to get the end date.

  • How to find first and last date of a fiscal week using SQL

    Hello,
    I want information about FISCAL Week, means a Week based on ISO standard. I know format strings ‘IW’ or ‘IYYY’ gives fiscal week and fiscal year respectively from a given date. But I want to find the first and last date of a fiscal week. Say suppose I have a fiscal week is 2, and fiscal year is 2008, how to find the start and end date of the given fiscal week.
    Any kind of help would be greatly appreciable.
    Thanks,
    Prince

    davide gislon wrote:
    The following query evaluate the begin of a fisical week, where &year and &week are respectively the year and week you want to calculate.
    To evaluate the end of the week you have to add 6.
    Note that my database is set to have monday as day number 1 of the week, and sunday as day number 7; if your database settings are different you should modify the query accordingly.
    SELECT CASE TO_CHAR(TO_DATE('&year','YYYY'),'D')
    WHEN '1' THEN TO_DATE('&year','YYYY')+((&week-1)*7)
    WHEN '2' THEN TO_DATE('&year','YYYY')+((&week-1)*7-1)
    WHEN '3' THEN TO_DATE('&year','YYYY')+((&week-1)*7-2)
    WHEN '4' THEN TO_DATE('&year','YYYY')+((&week-1)*7-3)
    WHEN '5' THEN TO_DATE('&year','YYYY')+((&week-1)*7+3)
    WHEN '6' THEN TO_DATE('&year','YYYY')+((&week-1)*7+2)
    WHEN '7' THEN TO_DATE('&year','YYYY')+((&week-1)*7+1)
    END BEGIN_FISICAL_WEEK
    FROM DUAL
    Hope this is helpful.
    Cheers,
    Davide
    Edited by: davide gislon on 08-Jan-2009 07:19Your query does nothing you say it does. TO_DATE('&year','YYYY') returns first day of the current month for year &year. And the only reason it returns January 1, &year is that we are currently in January:
    SQL> select TO_DATE('&year','YYYY') from dual
      2  /
    Enter value for year: 2005
    old   1: select TO_DATE('&year','YYYY') from dual
    new   1: select TO_DATE('2005','YYYY') from dual
    TO_DATE('
    01-JAN-05
    SQL> As soon as we roll into February:
    SQL> alter system set fixed_date = '2009-2-1' scope=memory
      2  /
    System altered.
    SQL> select sysdate from dual
      2  /
    SYSDATE
    01-FEB-09
    SQL> select TO_DATE('&year','YYYY') from dual
      2  /
    Enter value for year: 2005
    old   1: select TO_DATE('&year','YYYY') from dual
    new   1: select TO_DATE('2005','YYYY') from dual
    TO_DATE('
    01-FEB-05
    SQL> alter system set fixed_date = NONE scope=both
      2  /
    System altered.
    SQL> select sysdate from dual
      2  /
    SYSDATE
    08-JAN-09
    SQL> But even if TO_DATE('&year','YYYY') would always return January 1, &year, or you would fix it to TO_DATE('0101&year','MMDDYYYY') it still would be wrong. ISO week rules are
    If January 1 falls on a Friday, Saturday, or Sunday, then the week including January 1 is the last week of the previous year, because most of the days in the week belong to the previous year.
    If January 1 falls on a Monday, Tuesday, Wednesday, or Thursday, then the week is the first week of the new year, because most of the days in the week belong to the new year.Therefore, next year:
    SQL> DEFINE YEAR=2010
    SQL> DEFINE WEEK=1
    SQL> ALTER SESSION SET NLS_TERRITORY=GERMANY -- enforce Monday as first day of the week
      2  /
    Session altered.
    SQL> SET VERIFY OFF
    SQL> SELECT CASE TO_CHAR(TO_DATE('0101&&year','MMDDYYYY'),'D')
      2  WHEN '1' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7)
      3  WHEN '2' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-1)
      4  WHEN '3' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-2)
      5  WHEN '4' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-3)
      6  WHEN '5' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+3)
      7  WHEN '6' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+2)
      8  WHEN '7' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+1)
      9  END BEGIN_FISICAL_WEEK
    10  FROM DUAL
    11  /
    BEGIN_FI
    04.01.10
    SQL> SELECT TRUNC(TO_DATE('0101&&year','MMDDYYYY'),'IW') FROM DUAL
      2  /
    TRUNC(TO
    28.12.09
    SQL> 2 user10772980:
    Use:
    SELECT  TRUNC(TO_DATE('0101&&year','MMDDYYYY'),'IW') + (&&week-1)*7 FISCAL_YEAR_&&YEAR._WEEK_&&WEEK
      FROM  DUAL
    FISCAL_YEAR_2010_WEEK_1
    28.12.09
    SQL> SY.

  • How to find FIRST and the LAST date of the month.

    Hello,
    I want to find the first and the last date of the current month through query. How is it possible please help.
    For example if the current month is july. The first date should be 01-JUL-2006 and the last date would be 31-JUL-2006.
    Please help me.
    Regards,
    Imran Baig

    Like this?
    SQL> select trunc(sysdate,'MM') "First_Day",
      2        last_day(sysdate) "Last_Day" from dual;
    First_Day Last_Day
    01-JUL-06 31-JUL-06
    SQL> select trunc(to_date('10-FEB-04'),'MM' ) "First_Day",
      2       last_day(to_date('10-FEB-04')) "Last_Day" from dual;
    First_Day Last_Day
    01-FEB-04 29-FEB-04

  • How to find First Program run in the Current Month in Foreground?

    Dear Experts,
    My requirement is that i need to find the First Program run date in the Current Month in foreground. The user must be allowed to run the Report only once for a month and if the next time he runs in the same month, it should not allow him to do so.
    Is there any Function Modules available? How to achieve this?
    Regards,
    Ramesh Manoharan

    Hello Ramesh,
    May be you can try with this code:
    INITIALIZATION.
      DATA:
      v_date TYPE datum,
      wa_indx TYPE indx.
    * Import the date to INDX table
      IMPORT date = v_date
        FROM DATABASE indx(xy)
        TO   wa_indx
        CLIENT sy-mandt
        ID 'DATE'.
      IF v_date IS NOT INITIAL.
        IF v_date+0(6) = sy-datum+0(6). "Check YYYYMM is same
          "Give your error message & exit
        ELSE.
          v_date = sy-datum.
    *     Export the date to INDX table
          EXPORT date = v_date
            TO DATABASE indx(xy)
            FROM   wa_indx
            CLIENT sy-mandt
            ID 'DATE'.
        ENDIF.
      ELSE.
        v_date = sy-datum.
    *   Export the date to INDX table
        EXPORT date = v_date
          TO DATABASE indx(xy)
          FROM   wa_indx
          CLIENT sy-mandt
          ID 'DATE'.
      ENDIF.
    Hope this is of some help.
    BR,
    Suhas

  • Finding first and last members of a group set

    Is there any example how to use 'first' and 'last' functions in an sql query ?
    I have tried to execute a query like this on the scott.emp table :
    select deptno,min(sal),max(sal),first(sal) from emp group by deptno;
    but I always get this message:
    ERROR at line 1:
    ORA-00904: "FIRST": invalid identifier
    btw I use Oracle RDBMS ver 9.1.0.3 for Solaris in my server.
    tx for your help
    sjarif

    Syarif,
    The FIRST and LAST functions, which became available with 9i, are used to find the first or last member of a ranked set. I'm not sure exactly what you are trying to do, but I can show you a query that should work (I don't have 9i handy at the moment). This query should give you the departments with the highest (first) and lowest (last) aggregate salaries:
    select deptno,
    min(deptno)
    keep (dense_rank first order by sum(sal) desc) highest_sal,
    min(deptno)
    keep (dense_rank last order by sum(sal) desc) lowest_sal
    from emp
    group by deptno
    Is there any example how to use 'first' and 'last' functions in an sql query ?
    I have tried to execute a query like this on the scott.emp table :
    select deptno,min(sal),max(sal),first(sal) from emp group by deptno;
    but I always get this message:
    ERROR at line 1:
    ORA-00904: "FIRST": invalid identifier
    btw I use Oracle RDBMS ver 9.1.0.3 for Solaris in my server.
    tx for your help
    sjarif

  • SQL select Statement -first day and last day of the month - 1 year from now

    Hi,
    I need to write a SQL to get the dates in between first day and last day of the month one year from now.
    SELECT last_day(add_months(sysdate,12)) as lastday from dual
    What could be the Query to get the first day of the month one year from now..
    ie ..Sysdate - 3-DEC-2009
    Result - 1-DEC-2010
    thank you

    Hi,
    You can use TRUNC with 2 arguments to get the first DATE in a month, year, quarter, week, hour, minute, ISO year, ...
    SELECT  TRUNC ( ADD_MONTHS ( SYSDATE
                               , 12
                  , 'MONTH'
                  )     AS first_of_month
    FROM    dual
    ;The DATE returned will be in the same month, year, quearter, ... as the first argument.
    \We convered the last day of the month in [your previous question|http://forums.oracle.com/forums/message.jspa?messageID=3942939#3942939].
    At that time, I warded about using LAST_DAY as a cutoff point; TRUNC is a much better way.
    For example, to find all appointment_dates in the current month next year:
    SELECT  *
    FROM    appointments
    WHERE   appointment_date >= TRUNC (ADD_MONTHS (SYSDATE, 12), 'MONTH')
    AND     appointment_date <  TRUNC (ADD_MONTHS (SYSDATE, 13), 'MONTH')Note that
    the first part of the WHERE clause calls for dates on or equal to the beginning of the 12th month in the future, but
    the second part of the WHERE clause calls for dates before, not equal to , the beginning of the 13th month in the future.

  • Query to find first and last call made by selected number for date range

    Hi,
    query to find first and last call made by selected number for date range
    according to filter:
    mobile_no : 989.....
    call_date_from : 25-april-2013
    call_date_to : 26-april-2013
    Please help

    Hi,
    It sounds like you want a Top-N Query , something like this:
    WITH    got_nums   AS
         SELECT     table_x.*     -- or list columns wanted
         ,     ROW_NUMBER () OVER (ORDER BY  call_date      ) AS a_num
         ,     ROW_NUMBER () OVER (ORDER BY  call_date  DESC) AS d_num
         FROM     table_x
         WHERE     mobile_no     = 989
         AND     call_date     >= DATE '2013-04-25'
         AND     call_date     <  DATE '2013-04-26' + 1
    SELECT  *     -- or list all columns except a_num and d_num
    FROM     got_nums
    WHERE     1     IN (a_num, d_num)
    ;This forum is devoted to the SQL*Plus and iSQL*Plus front ends. This question doesn't have anything to do with any front end, does it? In the future, you'll get better response if you post questions like this in the PL/SQL.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the SQL forum FAQ {message:id=9360002}

  • How to find when and what date my iphone was first switched on from a retailer

    how to find when and what date my iphone was first switched on from a retailer

    Depending on the Code version you are running you can look for this output . It will show when a SFP was removed and inserted.
    module-2# show port-config internal all  (This command wil differ of earlier versions of SAN OS )
    Mar 20 08:53:45 2011  00449361  fc2/20         ---   DOWN   Xcvr inserted          
    Mar 20 08:53:32 2011  00829429  fc2/20         ---   DOWN   Disable                
    Mar 20 08:53:32 2011  00826403  fc2/20         ---   DOWN   Disable                
    Mar 20 08:53:32 2011  00818936  fc2/20         ---   DOWN   Xcvr removed  

  • BIP eBusiness Suite Dates - How to include the last day of the month?

    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    I have a report that will generally be run for a month but can be run for any pair of dates representing the first and last date to be included in the report.
    When we pass the dates from Oracle Apps to the report it is truncating the date to midnight. This results in the last date entered 'NOT' being included in the report as the second date is marked as "midnight". When I attempt to simply add "=1" to the end date it fails due to formatting issues in apps (only). I have gotten this to work on our Enterprise edition server that we use for testing (only) but it fails in our apps environment.
    In APPs we input the date in the format "01-AUG-2007", and this is how it shows in the parm line before the report is submitted as well as in the "View Details" after the report is executed: http://home.swbell.net/grog1//work/req_details_5607586.jpg
    However it is odd in that we in the "View Log" entry it shows the date formatted as "2007/08/01 00:00:00": http://home.swbell.net/grog1/work/view_log_5607586.jpg
    Even odder is that under diagnostics, "View XML" the date is formatted third way as: "2007/08/01 00:00:00.0" (note it now includes tenths of a second): http://home.swbell.net/grog1/work/view_xml_5607586.jpg
    This of course makes it difficult to perform conversions and calculations on the date in the SQL.
    Is APPs doing some sort of 'timestamp' conversion?
    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    Any feedback is appreciated,
    Scott

    No. The problem/error occurs long before the data is formatted into xml for presentation to the format template.
    The error occurs in the SQL in the 'data' template when I attempt to add a day to the date. It either does not like the implicit conversion with the "+1" and then the use of the "between" with another date or if I attempt to manually convert it has problems with the format mask.
    Scott

  • How to create appointment occurs last day of each month

    Hi Preston,
    I am trying to create a monthly recurring appointment occurs on last day of every month in .Net. E.g. start at May 31, 2010 end at May 31 2011 every month.
    I specified the frequency as monthly, byMonthDay[0] = (sbyte)31. But this only generates the instances on those months contain the 31th day. My question is how to also create instances on 30th day for those months don't contain the 31th day.
    Thanks,
    John

    The recurrence rule logic is patterned after the recurrence
    logic in iCalendar (http://www.ietf.org/rfc/rfc2445.txt)
    If you have questions, first look there. Then look at the
    schema itself.
    In the schema the definition of DayOfMonth will handle
    negative numbers:
    <xs:simpleType name="DayOfMonth">
    <xs:restriction base="xs:byte">
    <xs:minInclusive value="-31"/>
    <xs:maxInclusive value="31"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="DayOfMonthList">
    <xs:sequence>
    <xs:element name="day" type="tns:DayOfMonth" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    So, the last day of the month would be -1. The second
    to last day would be -2 and so on.
    >>> On Wednesday, May 26, 2010 at 11:56 AM, Johnny
    77<[email protected]> wrote:
    > Hi Preston,
    >
    > I am trying to create a monthly recurring appointment occurs on last
    > day of every month in .Net. E.g. start at May 31, 2010 end at May 31
    > 2011 every month.
    >
    > I specified the frequency as monthly, byMonthDay[0] = (sbyte)31. But
    > this only generates the instances on those months contain the 31th day.
    > My question is how to also create instances on 30th day for those months
    > don't contain the 31th day.
    >
    > Thanks,
    > John

  • FI : Finding last day of last accounting period

    Hi,
    In fi, I am trying to find out the last date od the last accounting period.
    I.e, if december is my first accounting period, and i give 28.01.2009 , my current accounting period will be 02,so last date of last period(december 2008) would be 31.12.2008
    Similalry, if December is the start of the accounting period,meaning december is accounting period 1, the, last day of the last accounting period would be: 30.11.2007.
    Please let me know of function modules to:
    1.Find the last period
    2.find the last day of the last period
    Thanks in advance..
    sumita

    Hi,
    You can try using function module LAST_DAY_IN_PERIOD_GET to get the last day in a month/period.
    You might have to check with the help of FI consultant what Fiscal Variant needs to be used.
    Also uou can find out the previous month by subtracting 1 from the current month ( and if month - 1 = 0 previous period is 12 ).
    Regards,
    Ram

  • How to find Latch and what actions need to be taken when there is a latch

    Hi
    Can you please tell me how to find Latch and what actions need to be taken when there is a latch?
    Thanks
    Regards,
    RJ.

    1. What is a latch?
    Latches are low level serialization mechanisms used to protect shared
    data structures in the SGA. The implementation of latches is operating
    system dependent, particularly in regard to whether a process will wait
    for a latch and for how long.
    A latch is a type of a lock that can be very quickly acquired and freed.
    Latches are typically used to prevent more than one process from
    executing the same piece of code at a given time. Associated with each
    latch is a cleanup procedure that will be called if a process dies while
    holding the latch. Latches have an associated level that is used to
    prevent deadlocks. Once a process acquires a latch at a certain level it
    cannot subsequently acquire a latch at a level that is equal to or less
    than that level (unless it acquires it nowait).
    2. Latches vs Enqueues
    Enqueues are another type of locking mechanism used in Oracle.
    An enqueue is a more sophisticated mechanism which permits several concurrent
    processes to have varying degree of sharing of "known" resources. Any object
    which can be concurrently used, can be protected with enqueues. A good example
    is of locks on tables. We allow varying levels of sharing on tables e.g.
    two processes can lock a table in share mode or in share update mode etc.
    One difference is that the enqueue is obtained using an OS specific
    locking mechanism. An enqueue allows the user to store a value in the lock,
    i.e the mode in which we are requesting it. The OS lock manager keeps track
    of the resources locked. If a process cannot be granted the lock because it
    is incompatible with the mode requested and the lock is requested with wait,
    the OS puts the requesting process on a wait queue which is serviced in FIFO.
    Another difference between latches and enqueues is that
    in latches there is no ordered queue of waiters like in enqueues. Latch
    waiters may either use timers to wakeup and retry or spin (only in
    multiprocessors). Since all waiters are concurrently retrying (depending on
    the scheduler), anyone might get the latch and conceivably the first one to
    try might be the last one to get.
    3. When do we need to obtain a latch?
    A process acquires a latch when working with a structure in the SGA
    (System Global Area). It continues to hold the latch for the period
    of time it works with the structure. The latch is dropped when the
    process is finished with the structure. Each latch protects a different
    set of data, identified by the name of the latch.
    Oracle uses atomic instructions like "test and set" for operating on latches.
    Processes waiting to execute a part of code for which a latch has
    already been obtained by some other process will wait until the
    latch is released. Examples are redo allocation latches, copy
    latches, archive control latch etc. The basic idea is to block concurrent
    access to shared data structures. Since the instructions to
    set and free latches are atomic, the OS guarantees that only one process gets
    it. Since it is only one instruction, it is quite fast. Latches are held
    for short periods of time and provide a mechanism for cleanup in case
    a holder dies abnormally while holding it. This cleaning is done using
    the services of PMON.
    4. Latches request modes?
    Latches request can be made in two modes: "willing-to-wait" or "no wait". Normally,
    latches will be requested in "willing-to-wait" mode. A request in "willing-to-wait" mode
    will loop, wait, and request again until the latch is obtained. In "no wait" mode the process
    request the latch. If one is not available, instead of waiting, another one is requested. Only
    when all fail does the server process have to wait.
    Examples of "willing-to-wait" latches are: shared pool and library cache latches
    A example of "no wait" latches is the redo copy latch.
    5. What causes latch contention?
    If a required latch is busy, the process requesting it spins, tries again
    and if still not available, spins again. The loop is repeated up to a maximum
    number of times determined by the initialization parameter SPINCOUNT.
    If after this entire loop, the latch is still not available, the process must yield
    the CPU and go to sleep. Initially is sleeps for one centisecond. This time is
    doubled in every subsequent sleep.
    This causes a slowdown to occur and results in additional CPU usage,
    until a latch is available. The CPU usage is a consequence of the
    "spinning" of the process. "Spinning" means that the process continues to
    look for the availability of the latch after certain intervals of time,
    during which it sleeps.
    6. How to identify contention for internal latches?
    Relevant data dictionary views to query
    V$LATCH
    V$LATCHHOLDER
    V$LATCHNAME
    Each row in the V$LATCH table contains statistics for a different type
    of latch. The columns of the table reflect activity for different types
    of latch requests. The distinction between these types of requests is
    whether the requesting process continues to request a latch if it
    is unavailable:
    willing-to-wait If the latch requested with a willing-to-wait
    request is not available, the requesting process
    waits a short time and requests the latch again.
    The process continues waiting and requesting until
    the latch is available.
    no wait If the latch requested with an immediate request is
    not available, the requesting process does not
    wait, but continues processing.
    V$LATCHNAME key information:
    GETS Number of successful willing-to-wait requests for
    a latch.
    MISSES Number of times an initial willing-to-wait request
    was unsuccessful.
    SLEEPS Number of times a process waited a requested a latch
    after an initial wiling-to-wait request.
    IMMEDIATE_GETS Number of successful immediate requests for each latch.
    IMMEDIATE_MISSES Number of unsuccessful immediate requests for each latch.
    Calculating latch hit ratio
    To get the Hit ratio for latches apply the following formula:
    "willing-to-wait" Hit Ratio=(GETS-MISSES)/GETS
    "no wait" Hit Ratio=(IMMEDIATE_GETS-IMMEDIATE_MISSES)/IMMEDIATE_GETS
    This number should be close to 1. If not, tune according to the latch name
    7. Useful SQL scripts to get latch information
    ** Display System-wide latch statistics.
    column name format A32 truncate heading "LATCH NAME"
    column pid heading "HOLDER PID"
    select c.name,a.addr,a.gets,a.misses,a.sleeps,
    a.immediate_gets,a.immediate_misses,b.pid
    from v$latch a, v$latchholder b, v$latchname c
    where a.addr = b.laddr(+)
    and a.latch# = c.latch#
    order by a.latch#;
    ** Given a latch address, find out the latch name.
    column name format a64 heading 'Name'
    select a.name from v$latchname a, v$latch b
    where b.addr = '&addr'
    and b.latch#=a.latch#;
    ** Display latch statistics by latch name.
    column name format a32 heading 'LATCH NAME'
    column pid heading 'HOLDER PID'
    select c.name,a.addr,a.gets,a.misses,a.sleeps,
    a.immediate_gets,a.immediate_misses,b.pid
    from v$latch a, v$latchholder b, v$latchname c
    where a.addr = b.laddr(+) and a.latch# = c.latch#
    and c.name like '&latch_name%' order by a.latch#;
    8. List of all the latches
    Oracle versions might differ in the latch# assigned to the existing latches.
    The following query will help you to identify all latches and the number assigned.
    column name format a40 heading 'LATCH NAME'
    select latch#, name from v$latchname;

  • Something was hidden in a download and now these double green underlined hyperlinks show up everywhere, and pop ups too whenever I click on ANYTHING. I can't figure out how to find it and get rid of it.

    Something was hidden in a download and now these double green underlined hyperlinks show up everywhere, and pop ups too whenever I click on ANYTHING. I can't figure out how to find it and get rid of it.

    You installed the "DownLite" trojan, perhaps under a different name. Remove it as follows.
    Malware is constantly changing to get around the defenses against it. The instructions in this comment are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
    Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "VSearch" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    /Library/LaunchDaemons/Jack.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /Library/PrivilegedHelperTools/Jack
    /System/Library/Frameworks/VSearch.framework
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    From the Safari menu bar, select
    Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    This trojan is distributed on illegal websites that traffic in pirated movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect much worse to happen in the future.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the DownLite developer has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight is inexcusable and has compromised the value of Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • How to get the last day of a month?

    HI,
    I want to know how to get the last day of a month.
    In my JClient form, I tried to get it by using oracle.sql.Date method, that is:
    lastday=oracle.sql.Date anydate.lastDayOfMonth();
    But it does not work. The result is lastday=anydate.
    Why?
    Stephen

    You can use the Calender class...
    Calendar c = Calendar.getInstance();
    and then something like...
    c.add(c.MONTH, 1);
    int dayOfMonth = c.get(Calender.MONTH);
    c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
    other usefull functions are:
    System.out.println(" YEAR : " + c.get(Calendar.YEAR));
    System.out.println(" MONTH : " + c.get(Calendar.MONTH));
    System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
    System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
    System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
    System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
    System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
    System.out.println(" HOUR : " + c.get(Calendar.HOUR));
    System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
    System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
    System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
    System.out.println(" SECOND : " + c.get(Calendar.SECOND));
    System.out.println();*/

Maybe you are looking for

  • Quality of service and conflicting engineer report...

    Moved into our new house and took up with BT fir broadband and telephone, however after connecting on 12th September, connection was terrible 110kps average, and the first call of many to broadband technical support started. So far the first engineer

  • RSA -- signing/verifying data

    assuming i have the public and private keys already.... class RSA{      Signature sign; ... //sets up keys and stuff      private void setupRSA(){           sign = Signature.getInstance("RSA");           sign.initSign(privateKey);           sign.init

  • Order settlement - MTO

    Hi Experts; I am new to MTO environment. I have a issue with production order settlement. 1. Can u please guide me the steps which i need to follow and what is the difference between order settlement process comparing with MTS. 2. What is the role of

  • Dought

    what is  the diff bt infopackage  group and process chain

  • List of Values (dynamic parameter) times out once and then works.

    Hello.  First time posting here.  I'm having a strange (yet very predictable) issue with Crystals Reports List of Values.  The List of Values is used on a dynamic cascading prompt and is published to the BO XI R2 repository.  The prompt/list works fi