How to caluclate tat between two dates of one timestamp field

Hi,
could some one help how to caluclate days between two dates of single timestamp filed and with this
query
Select * from m_activity_transaction where actn_opp_id in (
Select actn_opp_id from m_activity_transaction where ACTN_ACTV_ID = 218
Group by actn_opp_id
having count(*) > 1 ) and ACTN_ACTV_ID = 218
order by actn_performed_on
iam getting output is
ACTN_ID ACTN_OPP_ID ACTN_PERFORMED_ON
319415 95831 27-JAN-12 11.06.20.000000 AM
315249 95831 08-FEB-12 05.32.54.000000 PM
301927 103509 20-DEC-11 04.01.43.000000 PM
301458 103509 19-DEC-11 04.51.03.000000 PM
294841 115840 10-JAN-12 03.20.12.000000 PM
312062 115840 11-JAN-12 05.17.06.000000 PM
and i nedd to caluclate no.of days between two dates like 27-JAN-12 11.06.20.000000 AM and 08-FEB-12 05.32.54.000000 PM where actn_id is unique AND ACTN_OPP_ID IS NOT UNIQUE.
Thanks in Advance,
vvr.

This way?
with data as
select 315249 a, 95831 b, to_timestamp('27-JAN-12 11.06.20.000000 AM', 'DD-MON-RR HH.MI.SS.FF6 AM') dt from dual union all
select 319415, 95831, to_timestamp('08-FEB-12 05.32.54.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
select 301927, 103509 , to_timestamp('20-DEC-11 04.51.03.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
select 301458 , 103509 , to_timestamp('19-DEC-11 04.01.43.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
select 363810 , 144656 , to_timestamp('27-JUN-12 12.43.28.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
select 363500 , 144656 , to_timestamp('26-JUN-12 11.41.50.000000 AM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
select 363354 , 144656 , to_timestamp('25-JUN-12 12.41.13.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual
select a, b, diff
  from (
        select a, b, extract( day from (dt - lag(dt) over (partition by b order by dt, a)) ) diff
          from data
       ) tab
where tab.diff is not null;
A                      B                      DIFF                  
319415                 95831                  12                    
301927                 103509                 1                     
363500                 144656                 0                     
363810                 144656                 1

Similar Messages

  • How to get days between two dates

    Hi ,
    How to get days between two dates.
    Regards,
    Ramesh.

    Hi Ramesh,
    REPORT ZDATEDIFF.
    DATA: EDAYS   LIKE VTBBEWE-ATAGE,
          EMONTHS LIKE VTBBEWE-ATAGE,
          EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
                TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.

  • How to calculate days between two DATES

    How to calculate days between two DATES ?
    which is the functional module for that ?
    help me

    Hi,
    use function module : it works,
    HR_HK_DIFF_BT_2_DATES
    give output format = 03 and get the value in days.
    code is as below :
    data : DATE1 type P0001-BEGDA,
    DATE2 type P0001-BEGDA,
    YEARS type P0347-SCRYY,
    MONTHS type P0347-SCRMM,
    DAYS type P0347-SCRDD.
    date1 = '20070331'.
    date2 = '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
    DATE1 = date1
    DATE2 = date2
    OUTPUT_FORMAT = '03'
    IMPORTING
    YEARS = years
    MONTHS = months
    DAYS = days
    EXCEPTIONS
    INVALID_DATES_SPECIFIED = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write : days.
    Reward points, if helpful,
    Regards,
    Sandeep Kaushik

  • How to retrieve day between two dates?

    Hi all,
    Hope doing well,
    sir i am retrieving day between two dates in sql server like this.
    select datediff(day,'2012-10-03 00:00:00.000','2012-10-05 00:00:00.000')
    and getting result that is: 2
    but how this type of query i'll use in oracle?
    thanks,

    Just do minus
    diff := date_variable2-date_variable1;The difference sill be in days.
    If you want just the differences in days (Neglecting time part)
    diff := trunc(date2)-trunc(date1);

  • How to Calculate second between two dates?

    I'm wish to create a ref ID using seconds between two dates as the uniue number. I usually use DateDiff function in VB to calculate the ref ID. But now instead developing using VB, i'm using java in developing my project. I wonder is there any class similar to the datediff function? Please advice.Thank you

    diff_sec =( Date1.getSeconds() - Date2.getSeconds());

  • How to make search between two dates accept null not obligatory search proplem

    Hi guys when i search record between two dates it works ok success but you must enter date from and dateto first to  to make search
    i will show what i need from this example
    I need to search dynamic by 4 textbox
    1-datefrom
    2-dateto
    3-EmployeeNo
    4-EmployeeName
    but search i need must be dynamic meaning
    if i enter employee no only give me employee no found in database
    if i enter employee name give me employees found with this name using like
    if i enter all 4 text box null and enter button search get all data
    but i have proplem in this query when i need to search by click search button
    i must write date from and date to firstly then write employee no or employee name if i need to search
    so that i need to search by employee no alone or employee name alone without using date from and date to
    And if i search without using datefrom and dateto it give me message error 'string wasnot recognized as valid datetime"
    my stored procedure and code as following :
    ALTER proc [dbo].[CollectsearchData]
    @StartDate datetime,
    @EndDate datetime,
    @EmployeeID  NVARCHAR(50),
    @EmployeeName  nvarchar(50)
    as
    Begin
    Declare @SQLQuery as nvarchar(2000)
    SET @SQLQuery ='SELECT * from ViewEmployeeTest Where (1=1)'
    If (@StartDate is not NULL)
    Set @SQLQuery = @SQLQuery + ' And (joindate >= '''+ Cast(@StartDate as varchar(100))+''')'
    If (@EndDate is not NULL)
    Set @SQLQuery = @SQLQuery + ' And (joindate <= '''+ Cast(@EndDate as varchar(100))+''')' 
    If @EmployeeID <>''
    Set @SQLQuery = @SQLQuery + 'And (EmployeeID = '+ @EmployeeID+') '
    If @EmployeeName Is Not Null
    Set @SQLQuery = @SQLQuery + ' AND (DriverName LIKE
    ''%'+@EmployeeName+'%'') '
    Print @sqlQuery
    Exec (@SQLQuery) 
    End
    Function using
    public DataTable SearchDataA(string ConnectionString,string EmployeeNo,string EmployeeName, DateTime StartDate, DateTime EndDate)
    SqlConnection con = new SqlConnection(ConnectionString);
    SqlCommand cmd = new SqlCommand();
    cmd.Connection = con;
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.CommandText = "CollectsearchData";//work
    cmd.Parameters.Add("@StartDate", SqlDbType.DateTime);
    cmd.Parameters.Add("@EndDate", SqlDbType.DateTime);
    cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar, 50);
    cmd.Parameters.Add("@EmployeeName", SqlDbType.NVarChar, 50);
    cmd.Parameters["@StartDate"].Value = StartDate;
    cmd.Parameters["@EndDate"].Value = EndDate;
    cmd.Parameters["@EmployeeID"].Value = EmployeeNo;
    cmd.Parameters["@EmployeeName"].Value = EmployeeName;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    DataSet ds = new DataSet();
    da.Fill(ds);
    DataTable dt = ds.Tables[0];
    return dt;
    interface button search
     try
    CultureInfo ukCulture = new CultureInfo("en-GB");             
    FleetManagment.Fleet fleet = new FleetManagment.Fleet();
    DataTable Table = fleet.SearchDataA("Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "",textBox3.Text,textBox4.Text, DateTime.Parse(textBox1.Text,
    ukCulture.DateTimeFormat), Convert.ToDateTime(textBox2.Text, ukCulture.DateTimeFormat));
    dataGridView1.DataSource = Table;
    dataGridView1.Refresh();
    catch (Exception ex)
    MessageBox.Show(ex + "error");

    Yes, the below code should not be passed any value: (I am not sure of the syntax in .NET,Sorry) 
    --If startdate len is 0 - do not assign this value
    cmd.Parameters["@StartDate"].Value = StartDate;
    --If endate len is 0 - do not assign this value
    cmd.Parameters["@EndDate"].Value = EndDate;

  • How to count days between two dates excluding saterady and sunday

    Hi all
    iam working on oracle sql/plsql.
    In my application , i need to caliculate leave days between two dates excluding saterady and sunday
    Please tell me the solution if any one knows
    thanks in advance ,
    balu

    More modern version:
    WITH date_tab AS
    (SELECT TO_DATE ('&from_date', 'dd-MON-yyyy')
    + LEVEL
    - 1 business_date
    FROM DUAL
    CONNECT BY LEVEL <=
    TO_DATE ('&to_date', 'dd-MON-yyyy')
    - TO_DATE ('&from_date', 'dd-MON-yyyy')
    + 1)
    SELECT business_date
    FROM date_tab
    WHERE TO_CHAR (business_date, 'DY') NOT IN ('SAT', 'SUN');Thank you,
    Tony Miller
    Webster, TX
    Never Surrender Dreams!
    JMS
    If this question is answered, please mark the thread as closed and assign points where earned..

  • How to center object between two guides (or one guide and edge of artboard)

    Simple question: how can I center an object between two guides or between a guide and the edge of the artboard?

    Chris,
    You may (Smart Guides are your friends):
    1) Create a rectangle between the two Guides or between the Guide and the Artboard edge, by ClickDragging with the Rectangle Tool from (the desired spot) on one to (the desired spot) on the other (Smart Guides say path/path or path/page when you are there);
    2) Select both the rectangle from 1) and the object, then Click the rectangle again, then use the relevant options in the Align palette.
    That should move your object to the centre in the direction(s) you choose.

  • How to share library between two people on one computer

    How to i share my itunes library with my son who is on my PC?  Two users one pc two seperate Itunes account and it stinks.

    The only way to do this would be to move the catalog and photos to a removable drive. PSE is just not designed for multi-user situations.

  • How to share catalog between two users on one iMac?

    Using Photoshop elements 11:
    I built op my catalog, creating events, tagging people etc.
    Now I would like my girlfriend to also use this catalog. (I can build up a new catalog but then I lose all the events, tags etc).
    I put the pictures and catalog in a shared directory but I can't find a way to make Photoshop use my catalog when I go to my girlsfriend's account.
    How can I do this?
    Any help is very much appreciated
    Best regards
    Rob

    The only way to do this would be to move the catalog and photos to a removable drive. PSE is just not designed for multi-user situations.

  • How to get difference between two rows for a column field?

    hi, all,
    Could anyone show me what query statement is to get the difference betweem two rows for two column fields?
    The tables and its records are like this:
    id,      begin,      end
    p1         21          30
    p2          45          60
    p3          120          150
    I would like to have the query result like this
    id,    diff
    p1     15    --- which is 45 minus 30
    p2     60    --- which is 120 minus 60
    and so on...
    thank you in advance.
    Raffy

    You can use the LAG function to access values from previous rows:
    with q as (select 'p1' id, 21 v_start, 30 v_end from dual
    union all
    select 'p2', 45, 60 from dual
    union all
    select 'p3', 120, 150 from dual)
    select id, v_start, v_end, v_start - lag (v_end, 1, 0)
      over (order by id) v_diff from q
    ID,V_START,V_END,V_DIFF
    p1,21,30,21
    p2,45,60,15
    p3,120,150,60
    See the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions075.htm

  • How to find hours between sysdate and  max of timestamp field

    Hi,
    Could someone help me out of this query,when iam running thIs query iam getting this error
    and query is
    Select trunc((Sysdate - MAX(LASTMODIFIED))*24)||':'||trunc(Mod((Sysdate-MAX(LASTMODIFIED))*24*60,60))
    From STATUS_CLAIMS;
    ERROR:ORA-00932:INCONSISTENT DATATYPES:EXPECTED NUMBER
    GOT INTERVAL DAY TO SECOND
    ACTUALLY I NEED HOURS FROM SYSDATE MINUS MAX(LASTMODIFIED) DATE,
    WHERE LASTMODIFIED FIELD IS IN TIMESTAMP DATATYPE AND IT IS HAVING DEFAULT OF SYSTIMESTAMP
    Any suggestions on what I am doing wrong would be greatly appreciated.
    Regards,
    Vikram

    Hi,
    I would use extract on interval datatype, then some to_char formating before concatenation :Scott@my11g SQL>!cat q.sql
    col last_modified for A25
    col delta for A30
    col deltahour for 999999999
    col deltamin for 999999999
    col deltafmt for A8
    with t(last_modified) as
         select to_timestamp('20120622 12:34:56.789','yyyymmdd hh24:mi:ssxff') from dual
         union all
         select to_timestamp('20120622 01:03:45.678','yyyymmdd hh24:mi:ssxff') from dual
         union all
         select to_timestamp('20120522 01:03:45.678','yyyymmdd hh24:mi:ssxff') from dual
    ------ end of sample data ------
    select
         last_modified
         , cast(sysdate as timestamp)-last_modified delta
         , extract(hour from cast(sysdate as timestamp)-last_modified) deltahour
         , extract(minute from cast(sysdate as timestamp)-last_modified) deltamin
         ,to_char(extract(hour from cast(sysdate as timestamp)-last_modified),'fm00')
              || ':'
              || to_char(extract(minute from cast(sysdate as timestamp)-last_modified),'fm00') deltafmt
    from t
    Scott@my11g SQL>@q
    LAST_MODIFIED             DELTA                           DELTAHOUR   DELTAMIN DELTAFMT
    22/06/2012 12:34:56       +000000000 02:36:14.211000000           2         36 02:36
    22/06/2012 01:03:45       +000000000 14:07:25.322000000          14          7 14:07
    22/05/2012 01:03:45       +000000031 14:07:25.322000000          14          7 14:07But I'd feel safer with interval datatype as it wouldn't hide the potential days in the gap.

  • How to calculate the month difference between two date char. in Query?

    Customers would like to see how many months passed between two date type of characteristics (e.g., the month difference between the current date and the scheduled delivery date in the record) and put the result into the column as KF. 
    We would have to grab the fiscal year/period kind of value and then do the subtraction, e.g., if the current date value is 2/28/2008 and the scheduled delivery date value in the record is 12/01/2007, the correct result should be 2 month difference between these two date values, but could someone here give us the technical light on how to make this happen in query design?
    Thanks and we will give you reward points for the correct anwsers!

    Hi Kevin,
    The Badi is RSR_OLAP_BADI.
    You can create an implementation using Transaction  SE18.
    The implementation is per cube and is defined in the filters.
    In the Implementation you have the following methods :
    1. Define : Here you will provide the Keyfigure you need as a virtual one.
    2. Initilialize : Any Init Function you want to do.
    3. Compute. This is called per datarecord and here you can cimpute your value.
    Hope this helps.
    Pralay Ahluwalia

  • Search between Two date Error

    Hi,
    i have create report using to table i have take search option in that report now i want to display report between two dates
    How to put Between Date Quary in search option in where Clause .
    My code is
    select      CRM_SALES_DEALs.id,
             "CRM_SALES_CUSTOMERS"."CUSTOMER_NAME" as "CUSTOMER_NAME",
          "CRM_SALES_SALESREPS"."REP_LAST_NAME"||', '||
          "CRM_SALES_SALESREPS"."REP_FIRST_NAME" as "REP_NAME",
          "CRM_SALES_DEALS"."DEAL_NAME" as "DEAL_NAME",
          "CRM_SALES_DEALS"."EMAIL" as "EMAIL",
          "CRM_SALES_DEALS"."DEAL_CLOSE_DATE" as "DEAL_CLOSE_DATE",
          "CRM_SALES_DEALS"."DEAL_AMOUNT" as "DEAL_AMOUNT",
          "CRM_SALES_DEALS"."DEAL_PROBABILITY" as "DEAL_PROBABILITY",
          "CRM_SALES_DEAL_STATUS_CODES"."STATUS_CODE" as "STATUS_CODE" ,
             "CRM_SALES_DEALS"."DATE_OF_QUARY" as "DATE_OF_QUARY",
             "CRM_SALES_DEALS"."DEAL_SOURCE" as "DEAL_SOURCE",
             "CRM_SALES_DEALS"."DEAL_AMOUNT" *
             "CRM_SALES_DEALS"."DEAL_PROBABILITY" / 100 weighted_forecast,
    (select count(*) from CRM_SALES_DEAL_products where deal_id = "CRM_SALES_DEALS".id) products,
    nvl("CRM_SALES_DEALS".updated_on,"CRM_SALES_DEALS".created_on) last_changed,
    t.territory_name,
    CRM_SALES_DEALS.qtr, "CRM_SALES_DEALS"."CONTACT_NAME" as "CONTACT_NAME",
    "CRM_SALES_DEALS"."ACTIVE_FLAG" as "ACTIVE_FLAG"
    from     
    "CRM_SALES_SALESREPS",
    "CRM_SALES_DEAL_STATUS_CODES" ,
    "CRM_SALES_CUSTOMERS",
    "CRM_SALES_DEALS",
    CRM_SALES_territories t
    where  
    CRM_SALES_customers.customer_territory_id = t.id(+) and
    "CRM_SALES_DEALS"."CUSTOMER_ID"="CRM_SALES_CUSTOMERS"."ID"(+)
    and      "CRM_SALES_DEALS"."DEAL_STATUS_CODE_ID"="CRM_SALES_DEAL_STATUS_CODES"."ID"(+)
    and      "CRM_SALES_DEALS"."SALESREP_ID_01"="CRM_SALES_SALESREPS"."ID"(+) and "CRM_SALES_DEALS"."ACTIVE_FLAG" ='Y' and (:p1_find is null or instr(upper("CRM_SALES_CUSTOMERS"."CUSTOMER_NAME"),upper(:p1_find))>0 or instr(upper("CRM_SALES_DEALS"."DEAL_NAME"),upper(:p1_find))>0 or
    instr(upper("CRM_SALES_SALESREPS"."REP_FIRST_NAME"||' '||"CRM_SALES_SALESREPS"."REP_LAST_NAME"),upper(:p1_find))>0)
    and
    (nvl(:P1_TERRITORY,0) = 0 or t.id= :P1_TERRITORY)
    and
    (nvl(:P1_ACCOUNT,0) = 0 or "CRM_SALES_CUSTOMERS".id = :P1_ACCOUNT)
    and
    (nvl(:P1_QUARTER,'0') = '0' or CRM_SALES_deals.qtr = :P1_QUARTER)
    and
    *("CRM_SALES_DEALS".created_on between :P1_CREATE_DATE and :P1_END_DATE ) >0 and*                                          *Here I have put Quary*
    instr(upper("CRM_SALES_DEALS"."CREATED_ON"),upper(nvl(:P1_CREATE_DATE,"CRM_SALES_DEALS"."CREATED_ON"))) > 0
    and
    nvl(DEAL_PROBABILITY,10) between nvl(:P1_MINIMUM_PROBABILITY,0) and nvl(:P1_MAXIMUM_PROBABILITY,100) AND
    (nvl(:P1_LEAD_SOURCE,'0') = '0' or CRM_SALES_DEALS.DEAL_SOURCE = :P1_LEAD_SOURCE)Show me Error Command not Properly Ended
    How can i search Between two date In Search option.
    Thanks

    I'm guessing that this is Jay???
    Please heed my numerous previous comments regarding formatting and those horrible full table aliases and upper case, double quoted names... Grrr...
    Anyway, try this...
    SELECT   CRM_SALES_DEALs.id,
             CRM_SALES_CUSTOMERS.CUSTOMER_NAME AS CUSTOMER_NAME,
                CRM_SALES_SALESREPS.REP_LAST_NAME
             || ', '
             || CRM_SALES_SALESREPS.REP_FIRST_NAME
                AS REP_NAME,
             CRM_SALES_DEALS.DEAL_NAME AS DEAL_NAME,
             CRM_SALES_DEALS.EMAIL AS EMAIL,
             CRM_SALES_DEALS.DEAL_CLOSE_DATE AS DEAL_CLOSE_DATE,
             CRM_SALES_DEALS.DEAL_AMOUNT AS DEAL_AMOUNT,
             CRM_SALES_DEALS.DEAL_PROBABILITY AS DEAL_PROBABILITY,
             CRM_SALES_DEAL_STATUS_CODES.STATUS_CODE AS STATUS_CODE,
             CRM_SALES_DEALS.DATE_OF_QUARY AS DATE_OF_QUARY,
             CRM_SALES_DEALS.DEAL_SOURCE AS DEAL_SOURCE,
             CRM_SALES_DEALS.DEAL_AMOUNT * CRM_SALES_DEALS.DEAL_PROBABILITY / 100
                weighted_forecast,
             (SELECT   COUNT ( * )
                FROM   CRM_SALES_DEAL_products
               WHERE   deal_id = CRM_SALES_DEALS.id)
                products,
             NVL (CRM_SALES_DEALS.updated_on, CRM_SALES_DEALS.created_on)
                last_changed,
             t.territory_name,
             CRM_SALES_DEALS.qtr,
             CRM_SALES_DEALS.CONTACT_NAME AS CONTACT_NAME,
             CRM_SALES_DEALS.ACTIVE_FLAG AS ACTIVE_FLAG
      FROM   CRM_SALES_SALESREPS,
             CRM_SALES_DEAL_STATUS_CODES,
             CRM_SALES_CUSTOMERS,
             CRM_SALES_DEALS,
             CRM_SALES_territories t
    WHERE   CRM_SALES_customers.customer_territory_id = t.id(+)
             AND CRM_SALES_DEALS.CUSTOMER_ID = CRM_SALES_CUSTOMERS.ID(+)
             AND CRM_SALES_DEALS.DEAL_STATUS_CODE_ID =
                   CRM_SALES_DEAL_STATUS_CODES.ID(+)
             AND CRM_SALES_DEALS.SALESREP_ID_01 = CRM_SALES_SALESREPS.ID(+)
             AND CRM_SALES_DEALS.ACTIVE_FLAG = 'Y'
             AND (:p1_find IS NULL
                  OR INSTR (UPPER (CRM_SALES_CUSTOMERS.CUSTOMER_NAME),
                            UPPER (:p1_find)) > 0
                  OR INSTR (UPPER (CRM_SALES_DEALS.DEAL_NAME), UPPER (:p1_find)) >
                       0
                  OR INSTR (
                       UPPER(   CRM_SALES_SALESREPS.REP_FIRST_NAME
                             || ' '
                             || CRM_SALES_SALESREPS.REP_LAST_NAME),
                       UPPER (:p1_find)
                    ) > 0)
             AND (NVL (:P1_TERRITORY, 0) = 0 OR t.id = :P1_TERRITORY)
             AND (NVL (:P1_ACCOUNT, 0) = 0
                  OR CRM_SALES_CUSTOMERS.id = :P1_ACCOUNT)
             AND (NVL (:P1_QUARTER, '0') = '0'
                  OR CRM_SALES_deals.qtr = :P1_QUARTER)
             AND CRM_SALES_DEALS.created_on BETWEEN :P1_CREATE_DATE
                                                 AND  :P1_END_DATE
             AND INSTR (
                   UPPER (CRM_SALES_DEALS.CREATED_ON),
                   UPPER (NVL (:P1_CREATE_DATE, CRM_SALES_DEALS.CREATED_ON))
                ) > 0
             AND NVL (DEAL_PROBABILITY, 10) BETWEEN NVL (:P1_MINIMUM_PROBABILITY,
                                                         0)
                                                AND  NVL (
                                                        :P1_MAXIMUM_PROBABILITY,
                                                        100
             AND (NVL (:P1_LEAD_SOURCE, '0') = '0'
                  OR CRM_SALES_DEALS.DEAL_SOURCE = :P1_LEAD_SOURCE)Cheers
    Ben

  • How can i get report between two dates?

    Hi
    how can i get report between two dates?
    for example i want get reports between 20/4/2002 & 27/4/2002.
    my table has date column and i can get first date( exam : .... where date:=a and/or ....i don't know this part)
    thanks alot.
    Regards
    The Oracle Reports Team
    http://otn.oracle.com/

    where exam_date between :from_date and :to_date
    from_date and to_date are user_parameter

Maybe you are looking for

  • CS5 no longer loads: preferences file is invalid. [was: need tech help]

    My copy of CS 5 no longer loads. get a message stating ".... could not initialize Photoshop because the preferences file is invalid 9 it was deleted ) " how do I fix this ????

  • Crystal report parameter issue in SAP B1 8.8

    Hi Experts, We are facing following issue in Crystal report SAP B1 8.8 version Can not open crystal report without mentioning optional parameters. User is forced to mention all parameters User should allow to open crystal report by mentioning mandeto

  • DVI to Component HD

    Hi there, I have a MBP (first one, Intel Core Duo, not Core 2 Duo). I have all connections from DVI to HDMI, SCART, S-Video, etc, but I would like to know if there is a way to get the DVI (digital HD) to Component (Analogue HD)? Basically, I want to

  • Reading multiple records in file adaptor

    Hi, I am trying to read records from one file and write them in another file. But the thing happened is it ready and write only first record. I check in the Audit... At receive it reads all three records, but in transform it takes only first record.

  • Poster frame working for anyone?

    On 10.6.7 iWeb 3.0.3 (501) Setting a poster frame for a QT inside of iWeb doesn't seem to take. One used to be able to set that frame in QTPro 7 but I am now on QT 10 and a lot of the functionality of QTPro has been removed. (sigh) Any suggestions? D