How to Code this Query

Hello, I'm using Access and need to code this query on SQL and I have this problem:
I have 3 tables: Movie, Actor, Acts_In
Movie table has fields: Movie_ID, movie_name, actor_1, actor_2, director
Actor table has fields: Actor_ID, first_name, last_name
Acts_IN table has fields: Movie_ID, Actor_ID
* actor_id and movie_id are primary keys
I have to create a query that allows me to search for a director, giving me a list of actors that have worked with that director, and all the movies they have acted in.
so far I have come up with this code, however:
select actor.first_name, actor.last_name, movie_name
from (actor inner join acts_in ON acts_in.actor_ID=actor.actor_id) inner JOIN movie
ON acts_in.movie_ID=movie.movie_id
group by actor.first_name, actor.last_name, movie_name;
This code gives me a list of all actors and all movies they acted in, but it does not give me specific actors in respect to a specific director, adding
where director="XYZ"
does not work as it gives me all actors that have worked with director XYZ but not all movies they have acted in. 
Thanks!

Grump. You should have provided us example data and DML, like this:
DECLARE @movies TABLE (movie_ID INT, movie_Name VARCHAR(50), director VARCHAR(75))
DECLARE @actors TABLE (actor_ID INT, first_name VARCHAR(50), last_name VARCHAR(50))
DECLARE @acts_in TABLE (movie_ID INT, actor_ID INT)
INSERT INTO @movies (movie_ID, movie_Name, director) VALUES
(1, 'Batman Returns', 'Tim Burton'),
(2, 'Charlie and the Chocolate Factory', 'Tim Burton'),
(3, 'Sweeney Todd', 'Tim Burton'),
(4, 'Alice in Wonderland', 'Tim Burton'),
(5, 'Edward Scissor Hands', 'Tim Burton'),
(6, 'From Hell', 'Albert Huges')
INSERT INTO @actors (actor_ID, first_name, last_name) VALUES
(1, 'Danny', 'DeVito'),
(2, 'Freddie', 'Highmore'),
(3, 'Helena', 'Bonham-Carter'),
(4, 'Johnny', 'Depp'),
(5, 'Mia', 'Wasikowska'),
(6, 'Micheal', 'Keaton'),
(7, 'Winona', 'Ryder')
INSERT INTO @acts_in (movie_id, actor_ID) VALUES
(1, 1),(1, 6),
(2, 2),(2, 4),
(3, 3),(3, 4),
(4, 4),(4, 5),
(5, 4),(5, 7),
(6, 4)
Which would have allowed us to come up with this:
SELECT m2.director, a.first_name, a.last_name, m2.movie_Name
FROM ((((@movies m
INNER JOIN @acts_in ai
ON m.movie_ID = ai.movie_ID)
INNER JOIN @actors a
ON ai.actor_ID = a.actor_ID)
INNER JOIN @acts_in ai2
ON a.actor_ID = ai2.actor_ID)
INNER JOIN @movies m2
ON ai2.movie_ID = m2.movie_ID)
WHERE m.director = 'Tim Burton'
GROUP BY m2.director, a.first_name, a.last_name, m2.movie_Name
IIRC the primary difference between TSQL and the "Access SQL" is the freakin parens. So that *should* run in access, which you appear to be using.
Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

Similar Messages

  • How to use this query in R12

    the query below , i am using in valueset :
    select * from AR_LOCATION_VALUES
    Where ar_location_values.location_segment_qualifier =
    'COUNTRY' and ar_location_values.location_structure_id in ( select location_structure_id from ar_system_parameters )
    how to use this query to set in R12?
    Thanks

    hi
    i am using the following query in 11i and i want to use the same in R12 :
    SELECT ar_location_values.location_segment_description,ar_location_values.location_segment_value,location_segment_id
    FROM AR_LOCATION_VALUES
    WHERE ar_location_values.location_segment_qualifier = 'COUNTRY'
    AND ar_location_values.location_structure_id IN
    (SELECT location_structure_id FROM ar_system_parameters)
    note: the table ar_location_values is obsolette in R12 so what is the replacement table in R12 for this?

  • How to modify this query to get the desired output format

    I hv written a Query to display all the parent table names and their primary key columns(relevant to this foreign key of the child table).The query is given below...
    SELECT DISTINCT(TABLE_NAME) AS PARENT_TABLE,COLUMN_NAME AS PARENT_COLUMN
    FROM ALL_CONS_COLUMNS
    WHERE CONSTRAINT_NAME IN (SELECT AC.R_CONSTRAINT_NAME
    FROM ALL_CONSTRAINTS AC
    WHERE AC.TABLE_NAME=TABLE_NAME
    AND AC.TABLE_NAME='&TABLE'
    AND AC.R_CONSTRAINT_NAME IS NOT NULL);
    This query will display all the parent tables and their primary key columns.Now my problem is that how to modify this query to also display the foreign key column name of the child table.
    I want the query result in the following format.The query should display the following columns.1)child table's name,2)child table's foreign key column name,3)the corresponding parent table's name,4)the parent table's primary key column name(which is the foreign key in the child table).
    For Example I want the output as follows...
    TAKE THE CASE OF SCOTT.EMP(AS INPUT TO YOUR QUERY)
    CHILD_TABLE CHILD_COLUMN PARENT_TABLE PARENT_COLUMN
    EMP DEPTNO DEPT DEPTNO
    In this result I hv used alias name for the columns.The query should display this only for the foreign keys in the child table.In the query which I sent to you earlier will give the parent table and the parent column names,But I also want to append the child table and child column names there.
    any help on how to tackle would be appreciated.

    Try this query
    SELECT c.table_name child_table,
         c.column_name child_column,
         p.table_name parent_table,
         p.column_name parent_column
    FROM user_constraints a,user_constraints b,user_cons_columns c,
         user_cons_columns p
    WHERE a.r_constraint_name=b.constraint_name and
          a.constraint_name=c.constraint_name and
          b.constraint_name=p.constraint_name and
          c.position=p.position
    ORDER BY c.constraint_name,c.position
    Anwar

  • How to rewrite this query without sub query please help me

    Hello All Good Evening,
    Could you please help me with this query, how can i write this query without sub query, or how can write this query another ways
    please help me
    select planno, status1, count(*) Counts from
    select a.ValetNO PlanNo  ,
    case 
         when JoinCode in ('00', '01', '02') then 'Actcess'
         when JoinCode in ('20', '21', '22', '23','38', '39') then
         'Secured' else 'Other' end Status1 ---, COUNT (*)
       from  dbo.ppt a(NOLOCK)  left join dbo.acts b on a.P_ID = b.P_ID and a.ValetNO  = b.ValetNO
    --group by a.ValetNO
      a group by planno, status1
    order by 2
    Thank you in Advance
    Milan

    Whats your objective here? Sorry, am not able to understand the reason for this change. 
    Try the below:(Not tested)
    ;With cte
    As
    select a.ValetNO PlanNo ,
    case
    when JoinCode in ('00', '01', '02') then 'Actcess'
    when JoinCode in ('20', '21', '22', '23','38', '39') then
    'Secured' else 'Other' end Status1 ---, COUNT (*)
    from dbo.ppt a(NOLOCK) left join dbo.acts b on a.P_ID = b.P_ID and a.ValetNO = b.ValetNO
    select planno, status1, count(*) Counts from cte
    a group by planno, status1
    order by 2
    Even below:
    select a.ValetNO PlanNo ,
    case
    when JoinCode in ('00', '01', '02') then 'Actcess'
    when JoinCode in ('20', '21', '22', '23','38', '39') then
    'Secured' else 'Other' end Status1 , COUNT (1)
    from dbo.ppt a(NOLOCK) left join dbo.acts b on a.P_ID = b.P_ID and a.ValetNO = b.ValetNO
    Group by a.ValetNO ,
    case
    when JoinCode in ('00', '01', '02') then 'Actcess'
    when JoinCode in ('20', '21', '22', '23','38', '39') then
    'Secured' else 'Other' end

  • How to solve this query

    hi,
    i have a product table like
    product month1 month2 month3 .................
    soap 1200 1256 1895 ............
    i want use a query where i can select column name with a parameter.
    like
    select month||:num from product;
    in num variable it cud be 1 to 10 of value that is dependent on my program.
    so how to make this query .
    thxs

    Hi,
    Here is an example that i am helpful.
    In the example , I am using a table 'table_name' which contains columns like
    assign_attribute1
    assign_attribute2
    assign_attribute15
    Now I will pass any number from 1 to 15 to the function.
    create or replace procedure pass_col_number(v_number varchar2) as
    v_sql varchar2(2000);
    v_assign_attribute1   varchar2(150);
    begin
    v_sql := 'select  assign_attribute'||v_number||'  from  table_name where person_id = 1345';
    execute immediate v_sql into v_assign_attribute1;
    dbms_output.put_line('v_assign_attribute1='||v_assign_attribute1);
    end;Edited by: Sreekanth Munagala on Dec 18, 2008 1:18 AM

  • How to combine this query so that i can display the ouput together

    I have no idea how to combine this query together.Someone please help.I want the ouput to display oni 1 result combining all together.
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('6910','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('6912','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('7344','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('8344','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    Edited by: 965547 on Nov 5, 2012 12:55 AM

    The only difference which i am seeing in your queries is the Operation ('6910', '6912','7344','8344')
    Then why don't you put all values in One like this
    Select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in *('6910', '6912','7344','8344','7976')* AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    Hope this will resolve your problem.
    Oracle-911

  • How to tune this query for the improve performance ?

    Hi All,
    How to tune this query for the improve performance ?
    select a.claim_number,a.pay_cd,a.claim_occurrence_number,
    case
    when sum(case
    when a.payment_status_cd ='0'
    then a.payment_est_amt
    else 0
    end
    )=0
    then 0
    else (sum(case
    when a.payment_status_cd='0'and a.payment_est_amt > 0
    then a.payment_est_amt
    else 0
    end)
    - sum(case
    when a.payment_status_cd<>'0'
    then a.payment_amt
    else 0
    end))
    end as estimate
    from ins_claim_payment a
    where a.as_of_date between '31-jan-03' and '30-aug-06'
    and ( a.data_source = '25' or (a.data_source between '27' and '29'))
    and substr(a.pay_cd,1,1) IN ('2','3','4','8','9')
    group by a.claim_number, a.pay_cd, a.claim_occurrence_number
    Thank you,
    Mcka

    Mcka
    As well as EXPLAIN PLAN, let us know what proportion of rows are visited by this query. It may be that it is not using a full table scan when it should (or vice versa).
    And of course we'd need to know what indexes are available, and how selective they are for the predicated you have in this query ...
    Regards Nigel

  • How to write this query to filter combination of few values

    Hi,
    I have a table CHIMM which is a transaction table and contains information of the vaccines given to a child.
    columns are: child_id, vacc_id, vacc_given_dt. I have to query for remaining vaccines.
    HEXA is a vaccine_id which is composite vaccine of DPT1,POL1,HBV1 & HIB1 (vaccine ids).
    I want to write to query if any of DPT1,POL1,HBV1 & HIB1 given then HEXA should not be displayed in the result.
    OR
    if HEXA is given then of course any of DPT1,POL1,HBV1 & HIB1 should not be displayed in the result.
    How to write this query?
    Regards

    Hi,
    I'm still not sure what the output you want from that sample data is. Do you just want the child_ids, like this
    CHILD_ID
           3
           4? If so, here's one way to get them:
    WITH     all_vacc_ids     AS
         SELECT     c.child_id
         ,     c.vacc_id          AS child_vacc_id
         ,     v.vacc_id
         ,     COUNT ( CASE
                             WHEN  c.vacc_id = 'HEXA'
                       THEN  1
                         END
                    )       OVER ( PARTITION BY  c.child_id
                                       )    AS hexa_itself
         FROM          vacc   v
         LEFT OUTER JOIN     chimm  c     PARTITION BY (c.child_id)
                          ON     c.vacc_id     = v.vacc_id
         WHERE   v.vacc_desc       = 'HEXA'     -- See note below
    SELECT       child_id
    FROM       all_vacc_ids
    WHERE       child_vacc_id     IS NULL
      AND       vacc_id     != 'HEXA'
      AND       hexa_itself     = 0
    GROUP BY  child_id
    rha2 wrote:there are alot of vaccines, i just put 3 for example. this query gives error: invalid relational operatorAre you saying that the vacc table contains other rows, but those other rows are not needed for this problem? It would be good if you included an example in the sample data. The query above considers only the rows in vacc where vacc_desc='HEXA'. You can have other rows in the vacc table, but they won't affect the output of this query. The query above makes no assumptions about the number of rows that have vacc_desc='HEXA'; it will report all child_ids who are missing any of them, regardless of the number (assuming the child does not have the 'HEXA' vacc_id itself, like child_id=1).
    You still haven't said which version of Oracle you're using. The query above will work in Oracle 10 (and higher).

  • How to write this query ?

    how to write this query ?
    list the emp name who is working for the highest avg sal department.
    I can use row_number over to get correct result. If we don't use this row_number function, just plain sql, how to do it ?
    the row_number version is like this
    select emp.* from emp ,
    select deptno, row_number() over (order by avg(sal) desc) r from emp
    group by deptno
    )e
    where e.r = 1
    and emp.deptno = e.deptno

    Hi,
    806540 wrote:
    how to write this query ?
    list the emp name who is working for the highest avg sal department.
    I can use row_number over to get correct result. If we don't use this row_number function, just plain sql, how to do it ?ROW_NUMBER is just plain SQL, and has been since Oracle 8.1.
    ROW_NUMBER (or its close relative, RANK) is the simplest and most efficient way to solve this problem. Why not do this the right way?
    the row_number version is like this
    select emp.* from emp ,
    select deptno, row_number() over (order by avg(sal) desc) r from emp
    group by deptno
    )e
    where e.r = 1
    and emp.deptno = e.deptno
    If there happens to be a tie (that is, two or more departments have the same average sal, and it is the highest), then the query above will only arbitrarily treat one of them (no telling which one) as the highest. Change ROW_NUMBER to RANK to get all departments with a claim to having the highest average sal.
    You could use the ROWNUM pseudo-column instead of ROW_NUMBER, if all you want to do is avoid ROW_NUMBER.
    Without using ROW_NUMBER or RANK, there are lots of ways involving other analytic functions, such as AVG and MAX.
    If you really, really don't want to use analytic functions at all, you can do this:
    SELECT     *
    FROM     scott.emp
    WHERE     deptno     IN  (
                      SELECT       deptno
                      FROM       scott.emp
                      GROUP BY  deptno
                      HAVING       AVG (sal) =  (
                                                       SELECT    MAX (AVG (sal))
                                               FROM          scott.emp
                                               GROUP BY  deptno
    ;

  • How to improve this query speed ?....help me

    How to improve the query speed. Any hints can u suggest in the query or any correction. Here i am using sample tables for checking purpose, When i am trying with my original values, this type of query taking longer time to run
    select ename,sal,comm from emp where(comm is null and &status='ok') or (comm is not null and &status='failed');
    Thanx in advance
    prasanth a.s.

    What about
    select ename,sal,comm from emp where comm is null and &status='ok'
    union all
    select ename,sal,comm from emp where comm is not null and &status='failed';
    Regards
    Vaishnavi

  • How to rewrite this query

    How can i rewrite this query so it uses less inner joins (it causes my temp space to explode :) )
    ( SELECT Waardes.*, Tellers.Nr_Dataitems, Tellers.Nr_Details FROM
    ( SELECT extractvalue(Value(el_node), 'Node/Id') node,
    extractvalue(Value(el_dataitem), 'Detail/Title') Node_Title,
    extractvalue(Value(el_dataitem), 'Detail/Value') Node_Value
    FROM PHILIPS_XML x,
    TABLE (xmlsequence (extract (value(x), '/Tree/Node'))) el_node,
    TABLE (xmlsequence (extract (value(el_node),
    'Node/DataItems/DataItem/DetailSet/Detail'))) el_dataitem
    ) Waardes
    INNER JOIN
    SELECT A.Node, A.Nr_Dataitems, B.Nr_details FROM
    SELECT extractvalue(Value(el_node), 'Node/Id') node,
    count(extract(Value(aaa), 'DataItem')) Nr_Dataitems
    FROM PHILIPS_XML x,
    TABLE (xmlsequence (extract (value(x), '/Tree/Node'))) el_node,
    TABLE (xmlsequence (extract (value(el_node),
    'Node/DataItems/DataItem'))) aaa
    GROUP BY extractvalue(Value(el_node), 'Node/Id')
    ) A
    INNER JOIN
    SELECT extractvalue(Value(el_node), 'Node/Id') node,
    count(extract(Value(bbb), 'Detail')) Nr_details
    FROM PHILIPS_XML x,
    TABLE (xmlsequence (extract (value(x), '/Tree/Node'))) el_node,
    TABLE (xmlsequence (extract (value(el_node),
    'Node/DataItems/DataItem'))) aaa,
    TABLE (xmlsequence (extract (value(aaa),
    'DataItem/DetailSet/Detail' ))) bbb
    GROUP BY extractvalue(Value(el_node), 'Node/Id')
    ) B
    on A.node = B.NODE
    ) Tellers
    ON Waardes.NODE = Tellers.NODE )

    1st Make sure all paths are absolute (start with '/', not just the node name).
    Which release are you using.. Is the document based on an XMLSchema, if so, what annotations were used when registered the XML Schema ?. What does the explain plan look like...

  • How to optmize this query

    How can I optimize this query? it's taking a long time to run
    SELECT A.COL1, B.COL2, C.COL3
    FROM A, B, C
    WHERE A.COL1=B.COL2 (+)
    AND B.COL2=C.COL3 (+)
    Thank you!
    H

    ORA-02393: exceeded call limit on CPU usageContact your dba to increase this resource limit in your profile.
    An other way to write your query :
    select a.col1, null, null
    from a
    where not exists (select null from b where A.COL1=B.COL2)
    union
    select a.col1, b.col2, null
    from a,b
    where A.COL1=B.COL2
    and not exists (select null from c where b.COL1=c.COL2)
    union
    select a.col1, b.col2, c.col3
    from a,b, c
    where A.COL1=B.COL2
    and B.COL2=C.COL3;[pre]
    Nicolas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to update this query and avoid performance issue?

    Hi, guys:
    I wonder how to update the following query to make it weekend day aware. My boss want the query to consider business days only. Below is just a portion of the query:
    select count(distinct cmv.invoicekey ) total ,'3' as type, 'VALID CALL DATE' as Category
    FROM cbwp_mv2 cmv
    where cmv.colresponse=1
    And Trunc(cmv.Invdate)  Between (Trunc(Sysdate)-1)-39 And (Trunc(Sysdate)-1)-37
    And Trunc(cmv.Whendate) Between cmv.Invdate+37 And cmv.Invdate+39the CBWP_MV2 is a materialized view to tune query. This query is written for a data warehouse application, the CBWP_MV2 will be updated every day evening. My boss wants the condition in the query to consider only business days, for example, if (Trunc(Sysdate)-1)-39 falls in weekend, I need to move the range begins from next coming business day, if (Trunc(Sysdate)-1)-37 falls in weekend, I need to move the range ends from next coming business day. but I should always keep the range within 3 business days. If there is overlap on weekend, always push to later business days.
    Question: how to implement it and avoid performance issue? I am afraid that if I use a function, it greatly reduce the performance. This view already contains more than 100K rows.
    thank you in advance!
    Sam
    Edited by: lxiscas on Dec 18, 2012 7:55 AM
    Edited by: lxiscas on Dec 18, 2012 7:56 AM

    You are already using a function, since you're using TRUNC on invdate and whendate.
    If you have indexes on those columns, then they will not be used because of the TRUNC.
    Consider omitting the TRUNC or testing with Function Based Indexes.
    Regarding business days:
    If you search this forum, you'll find lots of examples.
    Here's another 'golden oldie': http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:185012348071
    Regarding performance:
    Steps to take are explained from the links you find here: {message:id=9360003}
    Read them, they are more than worth it for now and future questions.

  • How to code this?

    Hi All,
    Our application development will need to come up with a solution to update table B and tables C whenever a value in table A is changed to a certain value. Since I am new to Oracle stored procedures, I would like get some help on this. Can someone advice as to how to code the following? I greatly appreciate your ideas. Thanks!
    Scenario:
    Whenever the value on the column DCMTN_RCPT_STUS_CD is changed to "C" for table supplier_documentation (Table A), the value on the column BID_STUS_CD for table dmepos_bid will need to be updated to "01" (Table B), at the same time the column on BID_STUS_CD for supplier_application (Table C) will also
    need to be updated to "01".
    Table A:
    SQL> select SUPLR_ID, BIDDER_NUM, NSC_NUM, DCMTN_RCPT_STUS_CD from
    supplier_documentation where DCMTN_RCPT_STUS_CD='C';
    BIDDER_NUM DCMTN_RCPT_STUS_CD
    1000000 C
    1000003 C
    Table B:
    SQL>select BIDDER_NUM, BID_STUS_CD from dmepos_bid order by bidder_num;
    BIDDER_NUM BID_STUS_C
    1000000
    1000003
    Table C:
    SQL> select BIDDER_NUM, APLCTN_STUS_CD from supplier_application;
    BIDDER_NUM APLCTN_STUS_CD
    1000000
    1000003

    See Oracle row-level triggers:
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg13trg.htm#376
    SQL> create or replace trigger tr_01
      2  after update of DCMTN_RCPT_STUS_CD on supplier_documentation
      3  for each row
      4  when (new.DCMTN_RCPT_STUS_CD = 'C')
      5  begin
      6   update dmepos_bid set BID_STUS_C = :new.DCMTN_RCPT_STUS_CD
      7   where BIDDER_NUM = :new.BIDDER_NUM;
      8   update supplier_application set BID_STUS_C = :new.DCMTN_RCPT_STUS_CD
      9   where BIDDER_NUM = :new.BIDDER_NUM;
    10  end;
    11  /
    Trigger created.
    SQL> select * from supplier_documentation;
    BIDDER_NUM DC
       1000000
       1000003
    SQL> select * from dmepos_bid;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> select * from supplier_application;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> update supplier_documentation set DCMTN_RCPT_STUS_CD = 'B'
      2  where BIDDER_NUM = 1000000;
    1 row updated.
    SQL> select * from supplier_documentation;
    BIDDER_NUM DC
       1000000 B
       1000003
    SQL> select * from dmepos_bid;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> select * from supplier_application;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> update supplier_documentation set DCMTN_RCPT_STUS_CD = 'C'
      2  where BIDDER_NUM = 1000000;
    1 row updated.
    SQL> select * from supplier_documentation;
    BIDDER_NUM DC
       1000000 C
       1000003
    SQL> select * from dmepos_bid;
    BIDDER_NUM BI
       1000000 C
       1000003
    SQL> select * from supplier_application;
    BIDDER_NUM BI
       1000000 C
       1000003Rgds.

  • How to code this one?

    Please try to code the following:
    1. If payment end date (PA0014-ENDDA ) = '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) < Sept.01 of the current fiscal year.
    2. ELSEIf payment end date (PA0014-ENDDA ) = '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) > Aug 31 of the current fiscal year.
    3. ELSEIf payment end date (PA0014-ENDDA ) <> '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) > Aug31.
    4. ELSEIf payment end date (PA0014-ENDDA ) <> '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) < Sept.01 of the current fiscal year.
    5. ELSE.
       EXIT.
      ENDIF.
    NOTE: I have a problem on how you can determine if that particular date lies on that particular fiscal year or not. Please help me code this one.
    II. This are conditions between of each code.
    PAYMENT DATE is a variable should be used to store each successive payments.
    For Scenario 1, set (PAYMENT DATE ) = 1st payment date occuring after Aug 31 (Fiscal YEar)
    For Scenario 2, set (PAYMENT DATE ) = 1st payment date (SCREEN field: P0014-ZDATE)
    For Scenario 3, set (PAYMENT DATE ) = 1st payment date (SCREEN field: P0014-ZDATE)
    For Scenario 4, set (PAYMENT DATE ) = 1st payment date occuring after Aug 31 (Fiscal YEar)
    IF  the [Payment date] is <= to the infotype 0014 record end date (PA0014-ENDDA), do
    If the [Payment date] is in between the start and end date of the current Fiscal year
         If the unit (PA0014-ZEINH) is “Days”,
               [Payment date] = [Payment date] + (# of days)
               Add recurring payment (PA0014-BETRG) to total compensation counter
               Endif
         If the unit (PA0014-ZEINH) is “Weeks”, then {
                  [Payment date] = [Payment date] + (# of weeks)
               Add recurring payment (PA0014-BETRG) to total compensationcounter
         Endif
         If the unit (PA0014-ZEINH) is “Months”, then {
                  [Payment date] = [Payment date] + (# of months)
                Add recurring payment (PA0014-BETRG) to total compensation counter
         Endif
         If the unit (PA0014-ZEINH) is “Years”, then {
                   [Payment date] = [Payment date] + (# of years)
                Add recurring payment (PA0014-BETRG) to total compensation counter
         Endif  
    Endif
    Endif
    Repeat for next payment
    Repeat for the next infotype 0014 record (if it exists)
    I really need help! So guys whos expert in SAP. Thanx in Advance.

    >
    Dave Packard wrote:
    > Good day, everyone!
    > I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    >
    > The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    > Dave
    You can't do a join like this in SAP's open SQL.  You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a)  modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc. 
    Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round). 
    I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data.

Maybe you are looking for

  • Time capsule +usb hard drive

    I have an issue with connecting a WD 1T external drive to a time capsule. The HD is just for data sharing and wireless access, no backup. The HD is Mac formatted and perfectly works via direct USB connection with the Macbook. After running the Airpor

  • Exporting Library from 3.4 to use in 3.2.4

    Hello, I've made a big mistake in not backing up my Aperture library in Snow Leopard. I upgrade to Lion but a wasn't too happy with it. Along with lion I update Aperture as well. Now I'm back with SL and using Aperture 3.2.4 but I can't use the libra

  • Which QuickDock model is compatible with tx1410us notebook?

    Unfortunately the original product web page that listed the right docking station for this notebook is no longer up, so I wonder if anybody here can give me the right answer.  This Pavilion notebook has the Expansion Port 3 but I found at least two Q

  • Using an exsiting BI query in Web Dynpro

    I am interested in using an existing BI query in Web Dynpro.  The NetWeaver Developer Studio 7.0.06 contains some good documentation about how to create and execute an MDX statement on a BI cube.  However, I find this approach both complicated and im

  • 2008 R2 AD ... Specified replication partner, can I change this later during initial replication

    Hello - Healthy single forest, single domain with 100+ DC's.  Today, added new DC to the forest/domain and selected another DC in it's same site as it's replication partner during dcpromo, initial replication.  Turns out this other DC is in the same