Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Posts
    3

    Unanswered: extracting transactions from yesterday

    I am creating a script that needs to pull all transactions with any activity date of yesterday. I don't have a clue how to automatically pull the transactions based on the system date. I'd like this script to run without manual intervention.Can anyone help?

    from hrhistory,
    employee,
    paemployee
    where hrhistory.beg_date = '15-Sep_03'
    and hrhistory.employee = employee.employee
    and hrhistory.employee = paemployee.employee
    and fld_nbr IN ('2','5','7','8','9','13','14','20','156')
    and employee.employee IN
    (SELECT employee.employee
    from employee
    where employee.emp_status IN('AF','AP','LA','LT'))

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Try something to this effect ... Put it into a PL/SQL block

    declare
    v_today date;
    v_yesterday date;
    .....
    begin
    ....
    select trunc(sysdate), trunc(sysdate)-1
    into v_today, v_yesterday
    from dual;

    from hrhistory,
    employee,
    paemployee
    where hrhistory.beg_date between v_today and v_yesterday
    and hrhistory.employee = employee.employee
    and hrhistory.employee = paemployee.employee
    and fld_nbr IN ('2','5','7','8','9','13','14','20','156')
    and employee.employee IN
    (SELECT employee.employee
    from employee
    where employee.emp_status IN('AF','AP','LA','LT'));

    end;
    /

    HTH
    Gregg

  3. #3
    Join Date
    Mar 2002
    Posts
    3
    Thank you VERY much!

    Becky

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •