Find record count between two time stamps

Hi All,
Problem: My custom table having a datetime column ;
I want to find records processed between two time stamps.
say: records between 2010-04-28 10:15:00 and 2010-04-28 12:30:00
Could you please help me in this.
Thanks in advance
Karri

use To_date function in where column on that Dat_col
WHERE date_col BETWEEN TO_DATE ('2010-04-28 10:15:00',
'mm-dd-rrrr hh24:mi:ss')
AND TO_DATE ('2010-04-28 12:30:00',
'mm-dd-rrrr hh24:mi:ss')

Similar Messages

  • How to do find the difference between two time stamps

    Hi all,
    i have a table with 2 columns called GMT time and Local time . so i need to find difference between these two time stamps.
    i tried like this
    select to_date(GMT_TIME,'yyyy-mm-dd hh24:hi:ss')-to_date(LOCAL_TIME,'yyyy-mm-dd hh24:hi:ss') from date_table
    the result is coming as follows ..
    0.291666666667
    i did not under stand the out put.
    In my table GMT_TIME= 2011-06-26 00:00:00 and LOCAL_TIME=2011-06-25 17:00:00 ..
    please help me how to get exact hours between two dates ..
    Thanks
    Sreedhar

    Hi Sreedhar,
    Your output (0.2916666) has the unit day.
    You should multiply with 24 to get the unit hour.
    select ( to_date(GMT_TIME,'yyyy-mm-dd hh24:hi:ss')-to_date(LOCAL_TIME,'yyyy-mm-dd hh24:hi:ss') ) * 24 from date_table;Rgds,
    Tycho

  • Extract Time from date and Time and Need XLMOD Funtion to find the Difference between Two Time.

    X6 = "1/5/15 5:16 AM" & NOW ....................difference by Only Time
    not date
    X6 date and Time will be changing, Its not Constant
                Dim myDateTime As DateTime = X6
                Dim myDate As String = myDateTime.ToString("dd/MM/yy")
                Dim myTime As String = myDateTime.ToString("hh:mm tt")
                Dim myDateTime1 As DateTime = Now
                Dim myDate1 As String = myDateTime1.ToString("dd/MM/yy")
                Dim myTime1 As String = myDateTime1.ToString("hh:mm tt")
    Need to use this function to find the Difference between Two Time. due to 12:00 AM isuue
    Function XLMod(a, b)
        ' This replicates the Excel MOD function
        XLMod = a - b * Int(a / b)
    End Function
    Output Required
     dim dd  = XLMod(myTime - myTime1)
    Problem is myTime & myTime1 is String Need to convert them into Time, Later use XLMOD Funtion.

    Induhar,
    As an addendum to this, I thought I'd add this in also: If you have two valid DateTime objects you might consider using a class which I put together a few years ago
    shown on a page of my website here.
    To use it, just instantiate with two DateTime objects (order doesn't matter, it'll figure it out) and you'll then have access to the public properties. For this example, I'm just showing the .ToString method:
    Option Strict On
    Option Explicit On
    Option Infer Off
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim date1 As DateTime = Now
    Dim date2 As DateTime = #1/1/1970 2:35:00 PM#
    Dim howOld As New Age(date1, date2)
    MessageBox.Show(howOld.ToString, "Age")
    Stop
    End Sub
    End Class
    I hope that helps, if not now then maybe at some point in the future. :)
    Still lost in code, just at a little higher level.
      Thanx frank, can use this in Future....

  • Function Module to find the Difference between two times.

    Hi All,
    Wud you plz let me know the Function Module to find the Difference between two times.
    Input Time1( Hours:Minutes) Time2 ( Hours:Minutes)
    Need Output in Hours:Minutes only . ( No seconds Needed )
    Ex :
    Input :
           06:00 to 18:00 Output : 12:00
    and  20:00 to 06:00 Output: 10:00 with +ve sign only. No -ve sign.
    Thanks,
    N.L.Narayana

    check this .
    data : p_timel like sy-uzeit,
           p_timeh like sy-uzeit,
           diff like sy-uzeit,
           di(8) type c .
           p_timel = '200000'.
           p_timeh = '060000'.
           diff = p_timeh - p_timel.
           concatenate diff+0(2) ':' diff+2(2) into di.
           write:/ di.
    also check for this.
           p_timel = '060000'.
           p_timeh = '180000'.
    see if this can be implemented in ur code .
    or else  u can try with  Fm L_TO_TIME_DIFF passing startdate enddate starttime endtime with UOM as MIN
    hope this helps regards,
    vijay

  • Help I need to subtract times to find the difference between two times?

    Hello there, I really need help.
    I'm trying to make this attendance tracking system so that when a user enters his or her ID the system wll remember his/her check in time. However I also need to find out either how late the person is or how early to store their over time and late.
    So I get the time by using a timestamp, so I'm left with a timestamp that I store into the db. But the problem comes when trying to compute for the late or over time. To do that I have to get the normal login/checkin time from the employee schedules table in the db and either subtract that time from the checkInTime to compute for how late or subtract the checkIn time from it to find early.
    The thing is, the schedule is stored in datetime format in the db since the db is sql. Also I have no idea on how to subtract the two dates via java. The month, date and year stored in the sql db are just fillers, all I need computed is the time difference of the hours and minutes between the checkInTime and the schedule.
    I've tried to use datediff: SELECT e.employeeNumber, datediff('hh', startTime, checkInTime) as lateTime from employeeschedules e, timandattendance, contractualemployees c where c.scheduleNumber=e.scheduleNumber and t.employeeNumber=c.employeeNumber and t.checkInNumber=1;
    But it keeps on giving out various errors: You have an error in your sql syntax check your manual that corresponds to your sql server version. for the right syntax to use near , checkInTime) as lateTime from employeeschedules e, timandattendance, contractualemployees c where c.scheduleNumber=e.scheduleNumber and t.employeeNumber=c.employeeNumber and t.checkInNumber=1;
    My sql server is My SQL 5.0.5
    Now I'm thinking of useing Gregorian instead, but I don't know how to use Gregorian and dont know the various methods. Can someone tell me what to do, provide some sample codes and references that I can use to accomplish what I need to do?

    NewtonsApple_2 wrote:
    Now I'm thinking of useing Gregorian instead, but I don't know how to use Gregorian and dont know the various methods. Can someone tell me what to do, provide some sample codes and references that I can use to accomplish what I need to do?it may help...
    GregorianCalendar

  • Function Module to find the Diff bt Two Times : O/p : Hours:Minutes only

    Hi All,
    Wud you plz let me know the Function Module to find the Difference between two times.
    Input Time1( Hours:Minutes:Seconds) Time2 ( Hours:Minutes:Seconds)
    Need Output in Hours:Minutes only .  ( No seconds Needed )
    Thanks,
    N.L.Narayana

    Hi
    Please use FM
    <b>SD_DATETIME_DIFFERENCE</b>

  • How to find differene between two time fields??

    Hi Experts,
    I am trying to find difference between two time fields,  I have created two formula variables by using replacement path for the two time fields, I have taken dimension key NUMBER, because of this time format is converting to numbers for example if the time is 13:20:10 then it is converting to 1,32,010 then it is calculating, I am getting wrong values.
    Is there any options to find out the difference between two time fields.
    Thanks in advance,
    Venkat.

    use COPF_DETERMINE_DURATION. Its better you do it in data model itself.
    If you have date and time seperately use command
    use CONVERT TIMESTAMP command and
    then use this function module to get the difference in
    timestamp
    CCU_TIMESTAMP_DIFFERENCE
    us this in conjunction with the below function module
    DAYS_BETWEEN_TWO_DATES
    Edited by: Ananda Theerthan on Jan 21, 2010 7:18 AM

  • Unable to find line break between two lines in attachment file.

    Dear all I will be very great full if someone help me out,
    I am trying to send mail through SMTP server with an attachment of oracle report, but I am unable to find line break between two lines, when I down load the attachment from mail and open attach.txt file by double click on it. Next line starts right after previous line ends, it should starts with new line.
    In order to send an attachment file, I am reading source file line by line and put MIME protocol’s attachment instance, contain of source file is being properly written into target file if I open that attachment on cmd prompt.
    Following code may help you to understand the case.
    Thanks in advance.
    My code is as follows:-
    create or replace procedure bec_file_test
    v_subject varchar2, -- Subject of the email
    v_body varchar2, -- Body of the email
    v_from VARCHAR2 default 'XYZ.com', -- sender mail id
    v_to varchar2 default 'XYZ.com', -- Field To of the email
    v_cc varchar2 default 'XYZ.com' -- cc address
    ) is
    -- variable to hold the smtp server connection
    v_smtp_connection utl_smtp.connection;
    -- variable to hold the smtp host name
    v_smtp_host varchar2(100) default 'mail.bec-group.com';
    -- variable to hold the smtp port
    v_smtp_port number default 25;
    -- composite of {CR}{LF} caridge return and line feed.
    CRLF varchar2(2):=CHR(13)||CHR(10);
    cursor pr_rec is
    select requisition_no,line_no,release_no,a.contract,
    a.project_id,substr(a.activity_seq,1,11)ACT_SEQ,
    substr(a.part_no,1,12)PART_NO,
    substr(a.description,1,32)DESCRIPTION,
    substr(a.Bal_qty,1,8) BAL_QTY,
    substr(a.unit_meas,1,5)UOM,
    a.wanted_receipt_date WAN_REC_DT,
    a.latest_order_date LAT_ORD_DT
    from bec_pr_line_rep a
    where a.Bal_qty>0 and a.header_state not in 'Closed'
    and upper(a.state1) like 'RELEASED' and a.contract not in ('U1ENG','ULENG','U1FND','U2FND')
    and a.buyer_code='70306'
    order by a.part_no;
    begin
    declare
    fHandle UTL_FILE.FILE_TYPE;
    v_msg_line varchar2(2000);
    -- v_buffer varchar2(20000);
    --ALTER SYSTEM SET utl_file_dir = 'D:\Database\temp'
    --COMMENT='Temporary change on Dec 14'
    --SCOPE=SPFILE;
    SELECT name, value
    FROM gv$parameter
    WHERE name = 'utl_file_dir';
    --drop directory my_directory
    --CREATE or replace DIRECTORY my_directory AS 'D:\database\temp';
    --GRANT read,write ON DIRECTORY my_directory TO PUBLIC;
    begin ---writing data into a file.
    fHandle := UTL_FILE.FOPEN('MY_DIRECTORY', 'pending_pr_summry.txt', 'w');
    UTL_FILE.put_line(fHandle, ' Pending PR to process (detail report)');
    UTL_FILE.put_line(fHandle,TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
    UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
    UTL_FILE.put_line(fHandle, 'Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt' );
    UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
    for pr_temp in pr_rec loop
    begin
    v_msg_line:=to_char(rpad(pr_temp.requisition_no,12,' ')||'|'||
    lpad(pr_temp.line_no,3,' ')||'|'||
    lpad(pr_temp.release_no,3,' ')||'|'||
    rpad(pr_temp.contract,7,' ')||'|'||
    lpad(nvl(pr_temp.project_id,' '),7,' ')||'|'||
    lpad(nvl(pr_temp.act_seq,' '),12,' ')||'|'||
    lpad(pr_temp.part_no,12,' ')||'|'||
    rpad(pr_temp.description,35,' ')||'|'||
    lpad(pr_temp.bal_qty,10,' ')||'|'||
    rpad(pr_temp.uom,6,' ')||'|'||
    lpad(pr_temp.wan_rec_dt,14,' ')||'|'||
    lpad(pr_temp.lat_ord_dt,14,' '));
    UTL_FILE.put_line(fHandle,v_msg_line);
    end;
    end loop;
    UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
    UTL_FILE.put_line(fHandle, ' Regards : IFSAPP ( Application owner ) ');
    UTL_FILE.FCLOSE(fHandle); ------------writing into file is successfuly done here!
    --Reading of file starts here containt will be added in attchment file
    fHandle :=UTL_FILE.FOPEN('MY_DIRECTORY','pending_pr_summry.txt','R' );
    -- establish the connection to the smtp server
    v_smtp_connection := utl_smtp.open_connection(v_smtp_host, v_smtp_port); /** OPEN CONNECTION ON THE SERVER **/
    -- perform a handshake with the smtp server
    utl_smtp.helo(v_smtp_connection, v_smtp_host); /** DO THE INITIAL HAND SHAKE **/
    -- set the 'from' address of the message
    utl_smtp.mail(v_smtp_connection, v_from);
    -- add the recipient to the message
    utl_smtp.rcpt(v_smtp_connection, v_to);
    -- send the email
    utl_smtp.open_data(v_smtp_connection);
    v_msg_line:='Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || CRLF ||
    'From: ' || v_from || CRLF ||
    'Subject: ' || v_subject || CRLF ||
    'To: ' || v_to || CRLF ||
    'Cc: ' || v_cc || CRLF ||
    'MIME-Version: 1.0'|| CRLF || -- Use MIME mail standard
    'Content-Type: multipart/mixed;'||CRLF ||
    ' boundary="-----SECBOUND"'||CRLF||
    CRLF ||'-------SECBOUND'|| CRLF ||
    'Content-Type: text/plain;'|| CRLF ||
    'Content-Transfer_Encoding: 7bit'|| CRLF ||
    CRLF ||v_body|| CRLF;     -- Message body
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    v_msg_line:='-------SECBOUND'|| CRLF ||
    'Content-Type: application/octet-stream;'|| CRLF ||
    'Content-Type: text/plain;'|| CRLF ||
    'name="pending_pr_summry.txt"'|| CRLF ||
    'Content-Transfer_Encoding: 8bit'|| CRLF ||
    'Content-Disposition: attachment;'|| CRLF ||
    ' filename="pending_pr_summry.txt"'|| CRLF || CRLF;     -- Content of attachment
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    -- check file is opened
    IF utl_file.is_open(fHandle) THEN
    -- loop lines in the file
    LOOP
    BEGIN -- Content of attachment
    utl_file.get_line(fHandle,v_msg_line);
    v_msg_line:=concat(v_msg_line,CRLF);
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    END LOOP;
    END IF;
    --end of attachment containt     
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    UTL_FILE.FCLOSE(fHandle);
    utl_smtp.close_data(v_smtp_connection);
    utl_smtp.quit(v_smtp_connection);
    exception
    when utl_smtp.invalid_operation then
    dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
    when utl_smtp.transient_error then
    dbms_output.put_line(' Temporary e-mail issue - try again');
    when utl_smtp.permanent_error then
    dbms_output.put_line(' Permanent Error Encountered.');
    when others then
    dbms_output.put_line('Exception: SQLCODE=' || SQLCODE || ' SQLERRM=' || SQLERRM);
    RAISE;
    end;
    end bec_file_test;

    Pending PR to process (detail report)01-17-13 12:43:19 PM--------------------------------------------------------------------------------------------------------------------------------------------------Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt--------------------------------------------------------------------------------------------------------------------------------------------------MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade |500|kg |30-NOV-2012| 20-nov-2012MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012MAT/250606 | 2| |NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | |1|NMDCJ|6001|100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1|pkt | 25-DEC-2013| 14-dec-2013--------------------------------------------------------------------------------------------------------------------------------------------------
    where as source file is like that:-
    Pending PR to process (detail report)
    01-17-13 12:43:19 PM
    Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt
    MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade | 5500|kg | 30-NOV-2012| 20-nov-2012
    MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012
    MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012
    MAT/250606 | 2| 1|NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012
    MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012
    MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012
    MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1 |pkt | 25-DEC-2013| 14-dec-2013
    Ignore alignment. It is well formatted in source file.

  • Need to find the Difference between two table

    Hello ,
    I have stucked in program as below scenario:-
    I have two tables of huge data of same structure in a same schema.I need to find the difference exact values in tables.
    By using MINUS we can find the difference between two table ,i need to find the what exact difference in the there values with colunm and value at that column.
    Example TableA
    Col1 col2 col3 col4 col5.... col50
    10 ABC 2001 EE 444 TT
    40 XYZ 3002 RR 445 TT3
    80 DEF 6005 YY 446 YY8
    TableB
    Col1 col2 col3 col4 col5.... col50
    10 ABC 2001 EE 444 TT
    40 XYZ 3002 RR 445 TT3
    81 DEF 6005 Yu 447 YY8
    I need to the out put like this :-
    The Diffence between two table is
    TableA.COL1=80 TableB.Col1=81, Different
    TableA.Col4=YY TableB.col4=Yu,Different
    TableA.Col5=446TableB.col5=447,Different
    Please suggest me to write the pl/sql program for the same
    thanx in advance
    KK

    Thanx friends for all your efforts
    I have a sample code for the same,this will compare the two tables for single row in each table .
    what r the modification needed for the multiple rows of values in the two tables??
    Please suggest!!
    CREATE OR REPLACE PROCEDURE test_compare
    IS
    TYPE t_col
    IS
    TABLE OF VARCHAR2 (30)
    INDEX BY PLS_INTEGER;
    l_col t_col;
    j NUMBER := 0;
    l_sql VARCHAR2 (2000);
    col1 VARCHAR2 (30);
    col2 VARCHAR2 (30);
    val1 NUMBER;
    val2 NUMBER;
    status VARCHAR2 (30);
    CURSOR c1
    IS
    SELECT column_id, column_name
    FROM all_tab_columns
    WHERE table_name = 'TEST1';
    BEGIN
    FOR i IN c1
    LOOP
    j := j + 1;
    l_col (j) := i.column_name;
    END LOOP;
    FOR k IN 1 .. j
    LOOP
    l_sql :=
    'SELECT '
    || ''''
    || l_col (k)
    || ''''
    || ', '
    || 'TEST2.'
    || l_col (k)
    || ', '
    || ''''
    || l_col (k)
    || ''''
    || ', '
    || 'TEST1.'
    || l_col (k )
    || ', '
    || 'DECODE(TEST2.'
    || l_col (k)
    || ' -TEST1.'
    || l_col (k)
    || ', 0, ''NO CHANGE'', ''CHANGED'') FROM TEST2, TEST1';
    EXECUTE IMMEDIATE l_sql INTO col1, val1,col2, val2, status;
    IF status = 'CHANGED'
    THEN
    DBMS_OUTPUT.put_line( 'TEST2.'
    || col1
    || '='
    || val1
    || ', TEST1.'
    || col2
    || '='
    || val2
    || ', '
    || status);
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Error:- ' || SQLERRM);
    END;
    /

  • Find the difference between two columns in an ssrs matrix ? MSCRM

    Hi All,
    I am working in reporting part of our project (On-line MSCRM 2013) & in reporting services.
    I am trying to create report using fetch xml based. Below is the snap what we required the result.
    Kindly help me, how to get the difference in both column. (Its a matrix table where year is grouped).
    We need difference between both year Like (Plan Revenue of 2013 & Plan Revenue of 2014 difference in Plan Revenue Diff section) and same for Actual
    Revenue.
    https://social.microsoft.com/Forums/en-US/054d5ca4-0d38-4dc6-84a8-88866cc228fe/find-the-difference-between-two-columns-in-an-ssrs-matrix-mscrm?forum=crmdevelopment
    Thanks,
    Mohammad Sharique

    Hi Bro,
    I used parametrized option for year and done the report,Currently we are getting values in Difference column now i want to show
    that value in percentage. How can we show the percentage based on that value. Means i want to show the Difference in Percentage. 
    Kindly help me i tried but getting some issue. Below i am mentioning the code and snap with result.
    Below expression using to showing Plan Revenue in Percentage for year.
    =
    Sum(IIF(Fields!new_year.Value =Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    - Sum(IIF(Fields!new_year.Value =Parameters!EndYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    /IIF(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))>0,
    (Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0))))
    ,1)
    )*100))
    Result issue is as below in snap with highlighted in red colour.
    Kindly help me on this issue also :)

  • How to read time stamps from a spreadsheet and calculate the difference between consecutive time stamps?

    Hi,
    I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
    Time Stamp                    Power Output
    11:00:00 AM                       3kW
    11:00:02 AM                       2.9kW
    11:00:04 AM                       3.2kW
    11:00:06 AM                       3.1kW
    The above data doesn't make any sense, but it is just for the purpose of this question.
    So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request that is sent. Then I have to

    Repeated forum post
    Please view http://forums.ni.com/ni/board/message?board.id=170&message.id=294435
    Regards,
    Juan Galindo
    Applications Engineer
    National Instruments

  • Access Restriction - Internet Connection Policy (between two times)

    I want to say something about the Access Restriction.
    I set the policy for allow internet connection for one of my LAN PC's. For example, I set the policy to ALLOW internet connection EVERY DAY  from 8:00PM to 10:00PM. Starting with 10M internet connection stops. BUT, after a few minutes I do a power circle (turn OFF and turn ON the router) and I have internet connection again. For me, allowing internet connection from 8:00 PM to 10:00 PM means  to have internet connection ONLY BETWEEN THIS HOURS, not before and not after.
    In my opinion, this is the same situation with two DENY policies for internet connection, one from 12:00 AM to 8:00 PM and other from 10:00 PM to 11:55 PM (for the same PC, of course).
    Why POWER CIRCLE broken this policies ?
    ps - sorry for my English.

    @sunwatcher,
    If I set a policy for my little boy PCs ... for allowing internet connection from 4:00PM to 6:00PM (for example) ... after 6:00 PM internet connection stops and he turn OFF and turn ON the router (power circle)  and after that he have internet connection, from then for a long time ...
    I am from Romania, and I set time zone on GMT +2 (Bucharest time zone)
    I insist with this problem because I want for him to use internet only between two times. Outside this time frame I want him to do their homework.

  • How to find the difference between 2 time values in Java

    hi all,
    i have 2 time values
    String time1="6:20";
    String time2="21:30"
    How to find the difference between 2 times in Java?
    pls help
    thanx in advance....

    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

  • Count between two dates.

    dear friends
    i want fetch count between two dates.
    my query is like below.
    SELECT (to_date('19-mar-2012','dd-mm-yyyy')-to_date('01-apr-2012','dd-mm-yyyy')) FROM dual
    its given out like -13 but i want in positive mod like 13 only not '-' Sign.

    just use abs() function to your query to get the positive value
    SELECT abs(to_date('19-mar-2012','dd-mm-yyyy')-to_date('01-apr-2012','dd-mm-yyyy')) diff FROM dual

  • Find datetime difference between two fields and add the difference to the current datetime.

    Hi all,
    First I need to find the difference between the two date times fields (D1 and D2) and than add the diffence between them to the curent datetime to generate new datetime field (D3).
    D1                                                      
    D2
    2013-05-09 12:12:57.000              2013-05-09 12:12:57.000
    2013-05-10 12:12:57.000              2013-05-09 5:10:01.000
    2013-05-09 9:13:27.000                2013-05-11 11:00:21.000
    Thanks!

    Hey,
    You can try this
    SELECT  DATEDIFF(Day, D1, D2) as Date_Diff from Table_3 
    Replace day with
    other units you want to get the difference in, like second, minute etc.

Maybe you are looking for

  • Errro while installing sql server 2012 express edition on Windows 8 -64 version

    Hi, Im trying to install sql server 2012 express edition on windows 8 machine(64 bit),however im getting same error every time. The following error has occurred: The installer has encountered an unexpected error installing this package. This may indi

  • What to look for when buying used

    I'm planning on replacing my oooollddd G4 desktop, likely with a used MacBook if I get my way. I figure there are some things I know I can do to make sure it's in good, working condition. (And yeah, I realize there'll be some wear from having had an

  • AlV Grid Standard Buttons

    Hi ,             How to remove the standard buttons on the WD4A alv grid like View (Std. View) , Print Version , Export , Filter , Settings. Thanks, Kumar

  • Post tax in advanced customer payment

    can we post tax in F-29 down payment?  i check FBKP and found it is impossible. also can we post to liability account instead of AR reconcillation account in F-29? I checked the FBKP, the Special G/L account needs to be reconcillation. Any solution i

  • Return the cursor to original position in ABAP List

    There is an interactive List report, clicking on the lines in the main report leads to a secondary report and clicking on the line in secondary report gives a pop up screen. Depnding upon the selection made in pop up screen the data in the seconary r