A query to get all sales processed in 2007 ?

Hi All,
I got a requirement from user saying
" We have situations where "new" sales get processed against already existing or "old" sales orders. I need a query which shows all sales processed in year 2007 by sales order or whatever other identifier that is used"
This is not making any sense to me. Can anyone help me with this ? Is there something to do with ship date or anything? Please let me know!!
Thanks in advance
Prathibha

Hi Prathibha,
The only idea that came to my mind is the following: your customer sends order in a regular interval (weekly, monthly…) under a number that represents an agreement between you and your customer.
Under this scenario, you have one order created in the previous period from customer A that was partially shipped. In the current period, customer A sends a new order to you, but the quantity sent by your customer includes the balance. So, if new_quantity greater than old order balance, you will need to add an order with the balance.
Still under this scenario, the report could all orders in OM posted/shipped in 2007 under this agreement.
Just an idea, hope it helps,
Ketter Ohnes

Similar Messages

  • Oracle query to get all occurences of a text in a string

    Hi
    Does anybody know how to write a query to get all occurences of a text in a string in different rows of the table
    For eg:
    I have a string <aa>bb</aa><aa>cc</aa><aa>ddd</aa>
    I have to find every occurence of <aa> and get the data between <aa> and </aa>
    So the output should be
    bb
    cc
    ddd
    I think this can be done by using a regular expression but I dont know how.
    Can anyone help me?
    Thanks in advance.

    user2360027 wrote:
    BluShadow,
    The query gives correct results if i only have <aa></aa>
    What if i have <ff></ff>?
    Example:
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa><ff>dsd</ff>
    I want to have the following (dsd should not be there in the result)
    bb
    cc
    dddThis is a new requirement and not what you asked for in your original post. Perhaps you should tell us exactly what you are trying to achieve and what database version you are using to save us guessing.
    To crokitta,
    This version will deal with multiple rows..
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select '<aa>bb</aa><aa>cc</aa><aa>ddd</aa>' as x from dual union all
      2             select '<aa>xx</aa><aa>yy</aa>' from dual)
      3  -- end of test data
      4  select x, vals
      5  from (
      6    select x, regexp_replace(REGEXP_SUBSTR (x, '>[^<]+', 1, lvl),'[<>]') as vals
      7    from t
      8        ,(select level lvl from dual connect by level <= (select max(length(regexp_replace(x,'[^>]*'))/2) from t))
      9    )
    10  where vals is not null
    11* order by 1,2
    SQL> /
    X                                  VALS
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa> bb
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa> cc
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa> ddd
    <aa>xx</aa><aa>yy</aa>             xx
    <aa>xx</aa><aa>yy</aa>             yy
    SQL>

  • SQL Query to get All AD Groups and its users in Active Directory

    Hi,
       Is there any query to get all AD groups and its user in an instance of a SQL server?

    Check this blog.
    http://www.mikefal.net/2011/04/18/monday-scripts-%E2%80%93-xp_logininfo/
    It will give you more than what is required. If you dont want the extra information,then you can try this.. I took the query and removed the bits that you might not require.
    declare @winlogins table
    (acct_name sysname,
    acct_type varchar(10),
    act_priv varchar(10),
    login_name sysname,
    perm_path sysname)
    declare @group sysname
    declare recscan cursor for
    select name from sys.server_principals
    where type = 'G' and name not like 'NT%'
    open recscan
    fetch next from recscan into @group
    while @@FETCH_STATUS = 0
    begin
    insert into @winlogins
    exec xp_logininfo @group,'members'
    fetch next from recscan into @group
    end
    close recscan
    deallocate recscan
    select
    u.name,
    u.type_desc,
    wl.login_name,
    wl.acct_type
    from sys.server_principals u
    inner join @winlogins wl on u.name = wl.perm_path
    where u.type = 'G'
    order by u.name,wl.login_name
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Query for getting all function and procedure inside the packages

    hi All
    Please provide me Query for getting all function and procedure inside the packages
    thanks

    As Todd said, you can use user_arguments data dictionary or you can join user_objects and user_procedures like below to get the name of the packaged function and procedure names.
    If you are looking for the packaged procedures and functions source then use user_source data dictionary
    select a.object_name,a.procedure_name from user_procedures a,
                  user_objects b
    where a.object_name is not null
    and a.procedure_name is not null
    and b.object_type='PACKAGE'        
    and a.object_name=b.object_name

  • When i enter date range n vkorg iam getting all sales orginzation

    HI All,
    I have enter which you have given for me but its not working
    eg..
    it isfunction module
    import parameters
    all are options
    p_stdate=01.04.2005
    p_endate=30.04.2005
    p_kunnr= i will not enter any thing
    p_vkorg= m600
    so i have entered only date ranges and vkorg
    it shouled display only m600 sales orginzations but iam getting all sales orginzations
    the code i have retun----
    FUNCTION ZBAPI_CUSTOMER_DETAILS.
    ""Local interface:
    *" IMPORTING
    *" VALUE(P_STDATE) TYPE KNA1-ERDAT OPTIONAL
    *" VALUE(P_EDDATE) TYPE KNA1-ERDAT OPTIONAL
    *" VALUE(P_KUNNR) TYPE KNA1-KUNNR OPTIONAL
    *" VALUE(P_VKORG) TYPE KNVV-VKORG OPTIONAL
    *" VALUE(P_NAME1) TYPE KNA1-NAME1 OPTIONAL
    *" EXPORTING
    *" VALUE(RETURN) TYPE BAPIRETURN
    *" TABLES
    *" IT_CUSTOMER STRUCTURE ZBAPI_CUSTST
    ranges: lr_erdat for kna1-erdat,
    lr_kunnr for kna1-kunnr,
    lr_vkorg for knvV-vkorg,
    lr_NAME1 for kna1-NAME1.
    if P_kunnr IS not initial.
    lr_kunnr-sign = 'I'.
    lr_kunnr-option = 'EQ'.
    lr_kunnr-low = p_kunnr.
    append lr_kunnr.
    endif.
    if P_vkorg IS not initial.
    lr_vkorg-sign = 'I'.
    lr_vkorg-option = 'EQ'.
    lr_vkorg-low = p_vkorg.
    append lr_vkorg.
    endif.
    if P_name1 IS not initial.
    lr_name1-sign = 'I'.
    lr_name1-option = 'EQ'.
    lr_name1-low = p_name1.
    append lr_name1.
    endif.
    if not p_stdate is initial and not p_eddate is initial.
    lr_erdat-sign = 'I'.
    lr_erdat-option = 'BT'.
    lr_erdat-low = p_stdate.
    lr_erdat-high = p_eddate.
    append lr_erdat.
    endif.
    *select the General Data in Customer Master from kna1
    select kunnr land1 name1 name2 ort01 pstlz regio sortl stras telf1 telfx adrnr mcod1 mcod2 mcod3
    anred erdat ernam konzs ktokd name3 name4 spras telbx telf2 teltx fityp stcdt lzone
    into corresponding fields of table it_KNA1 from kna1
    where kunnr IN lr_kunnr AND
    name1 IN lr_name1 AND
    erdat IN lr_erdat .
    Move all the data to it_customer
    if sy-subrc = 0.
    loop at it_kna1.
    move-corresponding it_kna1 TO it_customer.
    append it_customer.
    clear it_customer.
    endloop.
    endif.
    *select Customer Master Partner Functions from knvp.
    if not it_customer[] is initial.
    select kunnr vkorg parvw
    into corresponding fields of table it_knvp
    from knvp FOR ALL ENTRIES IN it_customer
    where kunnr = it_customer-kunnr and
    vkorg in lr_vkorg .
    endif.
    Read Customer Master Partner Functions from it_knvp move it to it_customer
    loop at it_customer.
    read table it_knvp with key kunnr = it_customer-kunnr binary search.
    if sy-subrc = 0.
    it_customer-vkorg = it_knvp-vkorg.
    it_customer-parvw = it_knvp-parvw.
    modify it_customer.
    clear it_customer.
    endif.
    clear it_knvp.
    endloop.
    pls can you help in this code
    thanks
    mars

    HI All,
    I have enter which you have given for me but its not working
    eg..
    it isfunction module
    import parameters
    all are options
    p_stdate=01.04.2005
    p_endate=30.04.2005
    p_kunnr= i will not enter any thing
    p_vkorg= m600
    so i have entered only date ranges and vkorg
    it shouled display only m600 sales orginzations but iam getting all sales orginzations
    the code i have retun----
    FUNCTION ZBAPI_CUSTOMER_DETAILS.
    ""Local interface:
    *" IMPORTING
    *" VALUE(P_STDATE) TYPE KNA1-ERDAT OPTIONAL
    *" VALUE(P_EDDATE) TYPE KNA1-ERDAT OPTIONAL
    *" VALUE(P_KUNNR) TYPE KNA1-KUNNR OPTIONAL
    *" VALUE(P_VKORG) TYPE KNVV-VKORG OPTIONAL
    *" VALUE(P_NAME1) TYPE KNA1-NAME1 OPTIONAL
    *" EXPORTING
    *" VALUE(RETURN) TYPE BAPIRETURN
    *" TABLES
    *" IT_CUSTOMER STRUCTURE ZBAPI_CUSTST
    ranges: lr_erdat for kna1-erdat,
    lr_kunnr for kna1-kunnr,
    lr_vkorg for knvV-vkorg,
    lr_NAME1 for kna1-NAME1.
    if P_kunnr IS not initial.
    lr_kunnr-sign = 'I'.
    lr_kunnr-option = 'EQ'.
    lr_kunnr-low = p_kunnr.
    append lr_kunnr.
    endif.
    if P_vkorg IS not initial.
    lr_vkorg-sign = 'I'.
    lr_vkorg-option = 'EQ'.
    lr_vkorg-low = p_vkorg.
    append lr_vkorg.
    endif.
    if P_name1 IS not initial.
    lr_name1-sign = 'I'.
    lr_name1-option = 'EQ'.
    lr_name1-low = p_name1.
    append lr_name1.
    endif.
    if not p_stdate is initial and not p_eddate is initial.
    lr_erdat-sign = 'I'.
    lr_erdat-option = 'BT'.
    lr_erdat-low = p_stdate.
    lr_erdat-high = p_eddate.
    append lr_erdat.
    endif.
    *select the General Data in Customer Master from kna1
    select kunnr land1 name1 name2 ort01 pstlz regio sortl stras telf1 telfx adrnr mcod1 mcod2 mcod3
    anred erdat ernam konzs ktokd name3 name4 spras telbx telf2 teltx fityp stcdt lzone
    into corresponding fields of table it_KNA1 from kna1
    where kunnr IN lr_kunnr AND
    name1 IN lr_name1 AND
    erdat IN lr_erdat .
    Move all the data to it_customer
    if sy-subrc = 0.
    loop at it_kna1.
    move-corresponding it_kna1 TO it_customer.
    append it_customer.
    clear it_customer.
    endloop.
    endif.
    *select Customer Master Partner Functions from knvp.
    if not it_customer[] is initial.
    select kunnr vkorg parvw
    into corresponding fields of table it_knvp
    from knvp FOR ALL ENTRIES IN it_customer
    where kunnr = it_customer-kunnr and
    vkorg in lr_vkorg .
    endif.
    Read Customer Master Partner Functions from it_knvp move it to it_customer
    loop at it_customer.
    read table it_knvp with key kunnr = it_customer-kunnr binary search.
    if sy-subrc = 0.
    it_customer-vkorg = it_knvp-vkorg.
    it_customer-parvw = it_knvp-parvw.
    modify it_customer.
    clear it_customer.
    endif.
    clear it_knvp.
    endloop.
    pls can you help in this code
    thanks
    mars

  • Query to get all ports assigned and used by EBS instance.

    Hi,
    Can some one pleaase help to get
    Query to get all ports assigned and used by EBS instance.
    Help is appreaciated.
    Regards,
    Milan

    MILAN RATHOD wrote:
    Hi,
    Can some one pleaase help to get
    Query to get all ports assigned and used by EBS instance.
    Help is appreaciated.
    Regards,
    MilanIn addition to the thread referenced above by Helios, please check the context files and (Oracle E-Business Suite R12 Configuration in a DMZ [ID 380490.1] -- F. List of Ports to Open in a DMZ Configuration).
    Thanks,
    Hussein

  • Query to get all active customers in oracle apps

    Hi All,
    I want to grab all active customers account number, customer name, email address, tel number. Could any one give me the query to get it.
    Thanks,
    Red.

    Hi,
    Please refer to this document, and see if it helps.
    Note: 68046.1 - SQL Scripts To Extract Information Relating To A Particular Customer
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=68046.1
    Regards,
    Hussein

  • Mysql query not getting all the results, works fine in php

    Hi All,
    I have a slightly big query which works fine in php getting 400 results but in java I get only 14 results when I traverse through resultset. Here is the query
    (select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 left outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t2.sip_method='BYE' where t1.sip_method='INVITE' and (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1' ) union (select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 right outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t1.sip_method='INVITE' where t2.sip_method='BYE' and isnull(t1.username) and (t2.username='manoj' and t2.domain='mantragroup.com') and t2.callee_deleted != '1' ) order by ttime DESC limit 100,50
    Also this queru works fine on mysql console getting all 400 results. Please tell me what might be going wrong in Java.
    Thanks for your help and time,
    Manoj.

    How do you know you're doing the same query in PHP, MySQL, and the console?
    What's the code that's executing this?
    There's nothing intrinsically wrong with the query, although it's a bit messy - surely it could be simplified from that?
    Please format queries before posting in future. Also, did you really mean to let us know your company name and the name of a user? Seems a bit indiscrete.
         select
            t1.to_uri as inv_to_uri,
            t1.sip_to as inv_sip_to,
            t1.sip_callid as inv_callid,
            t1.time as inv_time,
            t1.fromtag as inv_fromtag,
            t1.sip_status as inv_status,
            t2.to_uri as bye_to_uri,
            t2.sip_to as bye_sip_to,
            t2.sip_callid as bye_callid,
            t2.time as bye_time,
            t2.fromtag as bye_fromtag,
            t2.totag as bye_totag,
            t2.from_uri as bye_from_uri,
            t2.sip_from as bye_sip_from,
            sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
            ifnull(t1.time, t2.time) as ttime ,
            'outgoing' as call_type
         from
            acc t1
         left outer join
            acc t2
         on
            t1.sip_callid=t2.sip_callid
         and
            (  (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
            or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
         and
            t2.sip_method='BYE'
         where
            t1.sip_method='INVITE'
         and
            (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1'
    union
         select
            t1.to_uri as inv_to_uri,
            t1.sip_to as inv_sip_to,
            t1.sip_callid as inv_callid,
            t1.time as inv_time,
            t1.fromtag as inv_fromtag,
            t1.sip_status as inv_status,
            t2.to_uri as bye_to_uri,
            t2.sip_to as bye_sip_to,
            t2.sip_callid as bye_callid,
            t2.time as bye_time,
            t2.fromtag as bye_fromtag,
            t2.totag as bye_totag,
            t2.from_uri as bye_from_uri,
            t2.sip_from as bye_sip_from,
            sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
            ifnull(t1.time, t2.time) as ttime ,
            'outgoing' as call_type
         from
            acc t1
         right outer join
            acc t2
         on
            t1.sip_callid=t2.sip_callid
         and
            (  (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
            or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
         and
            t1.sip_method='INVITE'
         where
            t2.sip_method='BYE'
         and
            isnull(t1.username)
         and
            (t2.username='manoj' and t2.domain='mantragroup.com')
         and
            t2.callee_deleted != '1'
    order by ttime DESC limit 100,50

  • Is there any query to get all faulted instance Ids which should be recoverd

    Hi All,
    I am working on a production Environment. I have four managed servers. Since the integration involves invoking legacy systems we are encountering either the JCA error or siebel adapter error ... so we wanted to recover as soon as faulted.If i have one managed servers i can easily find out the faulted instances .. since it was having four managed servers and more than 25 soa projects ... difficult to track it .... i need to click on each of the managed servers and get the faulted instances and recover it ...
    Can we have a query which shows all faulted instances in managed servers so that i can go directly to COMPOSITE ID and recover it..instead of going to all the 25 soa managed projects...and recovering it.
    Thanks in Advance,
    Venugopal SSS Raja

    Hi Venu,
    If I can understand your use case correctly, you want to monitor the status of the WLS instances.
    If yes, then you can use WLST to connect to the server and fetch the status. You can change this script to fetch the information of all servers and display at once.
    There is an example given @ http://weblogic-wonders.com/weblogic/2011/03/16/weblogic-server-state-using-wlst/
    See if this helps.
    Thanks,
    Patrick

  • Using LDAP query to get all the domains from all the forests in my company

    Foreword:
    I'm using two domain controller (dc1 and dc2). I'm using a domain registered to the root domain dc1 and simply request all of the domains in its forest by preforming search in the CN=Partitions,CN=Configuration,DC=dc1,dc=local.
    I can also get the root domain dns of my trusted forest (dc2) from the default naming context under "CN=System" by looking for an object of type "trustedDomain".
    The problem:
    The problem is that I can't see/find the other domains (childs) of the root domain dc2 from the active directory information found in dc1. In order to get these domains I currently bind to this domain controller (dc2) and preform the same search as I did in
    the domain controller dc1 (CN=Partitions,CN=Configuration,DC=dc2,dc=local) to get all its childs.
    Must I use this binding to each root domain in other forest in order to request all of its domains? Is there a better way to do it? I read about referrals which seems like a solution to my problem but I'm not sure if it is and I'm not sure how it should be
    used.
    Note : I'm using the DirectoryEntry class in C#.

    Hello,
    >> read about referrals which seems like a solution to my problem but I'm not sure if it is and I'm not sure how it should be used.
    Here are some information I found on the MSDN which might help you:
    Active Directory Searches Processes and Interactions
    Avoid unnecessary SearchResultReference referral chasing
    In the thread below, there is a code snpont shows the usage of this property:
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/fb338aed-4172-4132-a85e-f9bebdb74e00/when-does-adsi-refferal-chasing-work-?forum=winserverDS
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Extend existing tsql query to get all customers, even if they have no instances of the previous query - thought this would be easy, but...

    Hi all,
    The previous query is absolutely ok.
    The only thing i want to change is ...
    get all the previous available ve1 AND NEW: if a AGNR has no ve1-instance, regardless get an ve1-instance with the agnr filled but f.e. the other fields empty
    The grouping could made in reporting-logic later, and not in the tsql-query.
    resultset i need:
    - all agnr, if the have an ve1-instance or not
    Groups (hierarchy) i need, later in Report:
    - AGNR
       - ve1 (with all the left joind fields pg, vnfk, vnpk, vm (if they are)
       - if a agnr has no instance of ve1 --> print: "NO ver available"
    SELECT
    ve1.new_verid,
    ve1.new_no,
    ve1.statuscode,
    ve1.statuscodename,
    ve1.createdon,
    ve1.createdby,
    ve1.createdbyname,
    ve1.new_begin,
    DATEPART(yyyy, ve1.new_begin) AS begin_year,
    ve1.new_end,
    ve1.new_vn_fid,
    ve1.new_vn_fidname,
    ve1.new_vn_kid,
    ve1.new_vn_kidname,
    vnpk.new_how_old,
    ve1.new_vg,
    ve1.new_vgname,
    ve1.new_vs,
    ve1.new_vsname,
    ve1.new_vstat,
    ve1.new_vstatname,
    ve1.new_zw,
    ve1.new_zwname,
    ve1.new_bn_zw,
    ve1.new_rlz_v,
    ve1.new_pgid,
    ve1.new_pgidname,
    pg.accountnumber as pg_accountno,
    ve1.new_agnr_agnr_avmid,
    ve1.new_agnr_agnr_avmidname,
    AGNR.new_vm_kid AS vm_contactid,
    AGNR.new_vm_kidname AS vm_contactidname,
    ve1.new_efv,
    ve1.new_efvname,
    CASE
    WHEN ve1.new_vn_kid IS NOT NULL THEN 'Private Customer'
    WHEN ve1.new_vn_fid IS NOT NULL THEN 'Account Customer'
    ELSE 'Kunde'
    END AS kunde_typ,
    DATEPART(yyyy, vnpk.birthdate) as vnpk_birth_year,
    CASE
    WHEN ((ve1.new_rlz_v IS NOT NULL) OR (ve1.new_rlz_v > 0))
    THEN ve1.new_rlz_v
    WHEN (DATEPART(yyyy, ve1.new_begin) IS NOT NULL) AND (DATEPART(yyyy, vnpk.birthdate) IS NOT NULL)
    THEN 65 - ((DATEPART(yyyy, ve1.new_begin)) - (DATEPART(yyyy, vnpk.birthdate)))
    ELSE 20
    END AS vlz_calc,
    CASE
    WHEN ((ve1.new_bnj IS NOT NULL) OR (ve1.new_bnj > 0)) THEN ve1.new_bnj
    WHEN ((ve1.new_bn_zw IS NOT NULL) OR (ve1.new_bn_zw > 0))
    THEN
    CASE
    WHEN new_zw = '100000008' THEN ve1.new_bn_zw * 12
    WHEN new_zw = '100000004' THEN ve1.new_bn_zw * 4
    WHEN new_zw = '100000002' THEN ve1.new_bn_zw * 2
    WHEN new_zw = '100000001' THEN ve1.new_bn_zw * 1
    WHEN new_zw = '100000006' THEN ve1.new_bn_zw
    ELSE 0
    END
    ELSE 0
    END AS bnj_calc
    FROM
    Filterednew_ver AS ve1
    LEFT OUTER JOIN Filterednew_agnr AS AGNR
    ON ve1.new_agnr_agnr_avmid = AGNR.new_agnrid
    LEFT OUTER JOIN FilteredAccount AS pg
    ON ve1.new_pgid = pg.accountid
    LEFT OUTER JOIN FilteredAccount AS vnfk
    ON ve1.new_vn_fid = vnfk.accountid
    LEFT OUTER JOIN FilteredContact AS vnpk
    ON ve1.new_vn_kid = vnpk.contactid
    LEFT OUTER JOIN FilteredContact AS vm
    ON AGNR.new_vm_kid = vm.contactid
    WHERE
    (ve1.createdon >= @Begin_Week)
    AND (ve1.createdon <= @End_Week)
    AND (ve1.new_vg = @vg)
    AND (ve1.statuscode = '1')
    AND (ve1.new_efv <> '100000000' OR ve1.new_efv IS NULL)
    AND (ve1.new_vstat <> '100000004' OR ve1.new_vstat IS NULL)
    AND (ve1.new_zw IN ('100000008','100000004','100000002','100000001','100000006'))
    ORDER BY
    ve1.createdon
    i thought, and tried with right joins, but i think i need to change the sight (the complete query)?
    thx for all kind of help
    Greets Peb

    Hi Peb,
    Please provide sample data and expected results.

  • Query to get all General Ledger: Actual Line Items

    Hello All,
    I am developing a cash flow report. for this I write a query on FAGLFLEXA table but in my system business area is not mation in FAGLFLEXA table becouse customization is not done.
    so i want to use other table where i get Business are, company code, year and period.
    so can anybuddy send the query from i get all actual line items
    so can you help me...
    thanks in adv.
    Kaustubh

    Hello Balu Latpate 
    Thanks for u r reply
    but their is no entries in the GLPCT and GLPCA

  • Query to get all Project Server Customisation.

    Hello mate-
    I am trying to find sample queries which I can run in either published or reporting db in order to get all the front end level customization that I may have done in my PWA 2010 instance. Like,
    1. Users, Security. Groups, category.
    3. Views a& Setup.
    4. PDPs, workflows.
    5. project site and settings.
    6. time & task related settings and data
    etc,.,..
    I am planning to create a master data sheet for my customer.
    Thanks and looking forward to read from you guys.
    Dev EPM Consultant

    Hello,
    To data is stored in the Published DB, you shouldn't be querying this DB directly with T-SQL, you will need to use the PSI. The PDP's and workflows will be stored in the SP content database, again you shouldn't query this DB directly either, you will need
    to use the SP object model. If you are not familiar with the PSI, download the Project 2010 SDK:
    http://www.microsoft.com/en-gb/download/details.aspx?id=15511
    We have done something similar before that used the PSI to get all the Project Server config and wrote this to a word document - works very well but did take a lot of dev time.
    Alternatively look at a 3rd party product:
    http://www.fluentpro.com/productsfluentbooks.html
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Query to get all the worksheets for a particular work book

    Hi All,
    I want to get all the associated worksheets for a particular workbook. What query will fetch mne those details. Also, where can find the EUL5 tables documentation
    Regards
    Thomas

    Hi Tamir,
    Thanks so far. I am yet to make the crucial breakthrough as far my application goes. Are you talking about the EUL5_QPP_STATS table? I tried retrieving worksheets even from that table also with the following query
    SELECT DISTINCT Eul5QppStats.QS_DOC_NAME,Eul5QppStats.QS_DOC_DETAILS
    FROM EUL5_QPP_STATS Eul5QppStats,EUL5_DOCUMENTS Eul5Documents
    WHERE Eul5QppStats.QS_DOC_NAME = Eul5Documents.DOC_NAME
    However, the worksheet data retrieved by Discoverer Oracle's product is not matching my dataset for every workbook. Please suggest.
    Reg
    Thomas

  • Query to get all tables related to a given table directly or indirectly

    Does anyone have a query to get a list of tables that are directly or indirectly related to a given table by foreign keys?
    I used a CONNECT BY clause to get a list of all child tables and their child tables and so forth by going against the ALL_CONSTRAINTS table. I then UNIONed the result with another query that got all the parents/grandparents etc. for this table.
    I realized that I then need to get all the other child tables of these parent tables and their children and it sort of ran into an endless number of unions because we're traversing up and down a tree and are starting out from the middle.
    Is there a better way to do this?
    Thanks,
    Mohit

    Hello!
    Do you know transaction SUIM. From there you can find all roles with a given authorization. If you need a function maybe you can look which functions are used behind SUIM. For the tables check the table behind the fields in the transaction with F1.
    Best regards,
    Peter

Maybe you are looking for