Find records in table that match strin

Hello,
I have a comma delimited string that contains zip codes. I
need to find records in a table that match any of the zip codes in
the string. The database table is MS SQL. What is the best method
to do this?
Thanks in advance for any help!

ghanna wrote:
> Hello,
>
> I have a comma delimited string that contains zip codes.
I need to find
> records in a table that match any of the zip codes in
the string. The database
> table is MS SQL. What is the best method to do this?
>
> Thanks in advance for any help!
>
cfquery
select ...
from ...
where tablename.fieldname IN
(#listqulify(yourcommadelimitedlist*)#);
* pass it in as a variable
OR
where tablename.fieldname IN (<cfqueryparam
cf_sql_type="cf_sql_clob"
value="#yourlistvariable#" list="yes">);
you might want ot check up on the cfqueryparam syntax - i
have a feeling
i didn;t get it quiet right there... :)
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com

Similar Messages

  • How to get row count(*) for each table that matches a pattern

    I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
    Currently a single column is returned: tablename. I want to add the column RowCount.
    DECLARE @SQLCommand nvarchar(4000)
    DECLARE @TableName varchar(128)
    SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
    SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
    EXEC sp_executesql @SQLCommand

    The like operator requires a string operand.
    http://msdn.microsoft.com/en-us/library/ms179859.aspx
    Example:
    DECLARE @Like varchar(50) = '%frame%';
    SELECT * FROM Production.Product WHERE Name like @Like;
    -- (79 row(s) affected)
    For variable use, apply dynamic SQL:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Rows count all tables:
    http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • WCF Published Orch - Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

    I have an orchestration published as a web service.  It was working fine on our test environment, we deployed to production, and now getting this error.  The website wouldn't go in the BizTalk MSI, so we copied the files.  We reset the Authentication
    to match the test system (we are using Basic Auth).
    When we try to browse the webservice in the browser, it prompt for userid/password, we enter it, then it gives the following error. 
    I'm not even sure what it means by "base address", if URL was https://prod.mydomain.com/myapp/myservice.svc, would https://prod.mydomain.com be the based address? In the test environment, the URL is https://test.mydomain.com/myapp/myservice.svc. 
    In both environments, we have a customer calling this webservice.
    Also, I don't know what it means "scheme http".  We are using https:... on the URL.
    I'm thinking this is either security related, something to do with the app pool being different, or maybe something to do with bindings. 
    Thanks,
    Neal Walter
    http://MyLifeIsMyMessage.net
    Web.config:
        <services>
          <!-- Note: the service name must match the configuration name for the service implementation. -->
          <service name="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance" behaviorConfiguration="ServiceBehaviorConfiguration">
            <endpoint name="HttpMexEndpoint" address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
            <!--<endpoint name="HttpsMexEndpoint" address="mex" binding="mexHttpsBinding" bindingConfiguration="" contract="IMetadataExchange" />-->
          </service>
        </services>
      </system.serviceModel>
        <system.webServer>
            <security>
                <authorization>
                    <remove users="*" roles="" verbs="" />
                    <add accessType="Allow" users="myCustomer" />
                </authorization>
            </security>
        </system.webServer>
    Server Error in '/eSecuritelIn' Application.
    Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered
    base address schemes are [https].
    Description:
    An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the
    code. Exception Details: System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https].
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using
    the exception stack trace below.
    Stack Trace:
    [InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes
    are [https].]
       System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +16582113
       System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1
    addBaseAddress) +1082
       System.ServiceModel.ServiceHostBase.ApplyConfiguration() +156
       System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +215
       System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses) +400
       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHost`3..ctor(IsolatedReceiverType isolatedReceiver, BizTalkServiceInstance serviceInstance, Uri[] baseAddresses)
    +36
       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses) +533
       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172
    [ServiceActivationException: The service '/eSecuritelIn/eSecuritelIn_OrchPublished_RepairEquipmentService.svc' cannot be activated due to an exception during compilation. 
    The exception message is: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https]..]
       System.Runtime.AsyncResult.End(IAsyncResult result) +901424
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178702
       System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET
    Version:4.0.30319.272

    When you want to migrate Web Applications from one environment to other there are multiple ways to achieve it.
    1) Migrate in MSI- Export MSI and select the option for your Web Application, however I don't recommend this option
    2) Is to browse the folder for Web Application(Right click on web app and browse). Copy this folder(normally within inetpub folder) and take it to the inetpub folder of other environment. Later from the IISManager create application.
    Are you not using the same Binding file?
    Check you web.config file and see if the endpoint is configured for mexHTTpBinding.
    Old: binding="mexHttpBinding"
    New: binding="mexHttpsBinding"
    web.config snippet:
    <services>
    <service behaviorConfiguration="ServiceBehavior" name="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService">
    <endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBinding"
    contract="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService" />
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    </service>
    Also look into the below article- How to fix: "Could not find a base
    address that matches scheme http for the endpoint with binding WebHttpBinding" Errors
    Moving to https = Could not find a base address that matches scheme
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

  • Getting a "Could not find a base address that matches scheme net.tcp"

    I've written several WCF services which use HTTP (and its variants).  Now I'm trying to learn how to write a WCF service which will use TCP.  I'm using Andrew Troelsen's book, "Pro C# 2008 and the .NET 3.5 Platform" as a guide (chapter 25).  I've asked questions related to this before on a much more complicated WCF service, so I decided to write a simple WCF service to learn how to do it, rather than work on my more complicated WCF service.  Coincidentally I chose the same routine as Troelsen did in his book, although in my case I called the WCF service SimpleAdd.
    Anyway, after writing the WCF service, I then wrote the Windows Service to host it.  I then installed it, and the installation went fine.  When I tried to run the service, the service started but then immediately stopped.  I checked the event log and found the following message in it:
    "Service cannot be started. System.InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding MetadataExchangeTcpBinding. Registered base address schemes are [http]."
    Here's the interface code for my SimpleAdd:
    using System;  
    using System.Collections.Generic;  
    using System.Linq;  
    using System.Runtime.Serialization;  
    using System.ServiceModel;  
    using System.Text;  
    namespace SimpleAdd  
        // NOTE: If you change the interface name "IService" here, you must also update the reference to "IService" in App.config.  
        [ServiceContract]  
        public interface IService  
            [OperationContract]  
            int Add(int FirstNumber, int SecondNumber);  
    Here's the code for the implementation (I'm leaving out the using statements):
    namespace SimpleAdd  
        // NOTE: If you change the class name "Service" here, you must also update the reference to "Service" in App.config.  
        public class Service : IService  
            #region IService Members  
            int IService.Add(int FirstNumber, int SecondNumber)  
                return (FirstNumber + SecondNumber);  
            #endregion  
    And here's the App.Config file for the service:
    <?xml version="1.0" encoding="utf-8" ?> 
    <configuration> 
      <system.web> 
        <compilation debug="true" /> 
      </system.web> 
      <!-- When deploying the service library project, the content of the config file must be added to the host's   
      app.config file. System.Configuration does not support config files for libraries. --> 
      <system.serviceModel> 
        <services> 
          <service behaviorConfiguration="SimpleAdd.ServiceBehavior" name="SimpleAdd.Service">  
            <clear /> 
            <endpoint binding="wsHttpBinding" contract="SimpleAdd.IService" 
              listenUriMode="Explicit">  
              <identity> 
                <dns value="localhost" /> 
                <certificateReference storeName="My" storeLocation="LocalMachine" 
                  x509FindType="FindBySubjectDistinguishedName" /> 
              </identity> 
            </endpoint> 
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" 
              listenUriMode="Explicit">  
              <identity> 
                            <!--   
                <certificateReference storeName="My" storeLocation="LocalMachine" 
                  x509FindType="FindBySubjectDistinguishedName" /> 
                                --> 
              </identity> 
            </endpoint> 
            <endpoint address="net.tcp://localhost/SimpleAdd/" binding="netTcpBinding" 
              bindingConfiguration="" contract="SimpleAdd.IService" /> 
            <host> 
              <baseAddresses> 
                <add baseAddress="http://localhost:8731/Design_Time_Addresses/SimpleAdd/Service/" /> 
              </baseAddresses> 
            </host> 
          </service> 
        </services> 
        <behaviors> 
          <serviceBehaviors> 
            <behavior name="SimpleAdd.ServiceBehavior">  
              <serviceMetadata httpGetEnabled="true" /> 
              <serviceDebug includeExceptionDetailInFaults="false" /> 
            </behavior> 
          </serviceBehaviors> 
        </behaviors> 
      </system.serviceModel> 
    </configuration> 
    I don't think it will matter much, because I believe the problem probably lies in the App.config file for the Windows service, but just in case, here's the code for the AddWinService (without the using statements):
    namespace WindowsAddService  
        public partial class AddWinService : ServiceBase  
            //A member variable of type ServiceHost.  (I'm using the "Pro C# 2008" book as reference for this.)  
            private ServiceHost myHost;  
            public AddWinService()  
                InitializeComponent();  
            protected override void OnStart(string[] args)  
                //just to be really safe  
                if (myHost != null)  
                    myHost.Close();  
                    myHost = null;  
                //create the host  
                myHost = new ServiceHost(typeof(SimpleAdd.Service));    //I've included the class from SimpleAdd, which isn't in the book!!!  
                //open the host  
                myHost.Open();  
            protected override void OnStop()  
                //shut down the host  
                if (myHost != null)  
                    myHost.Close();  
    And lastly, here is the App.Config file from my AddWinService:
    <?xml version="1.0" encoding="utf-8" ?> 
    <configuration> 
        <system.serviceModel> 
            <client> 
                <endpoint address="net.tcp://localhost/SimpleAdd" 
                                    binding="netTcpBinding" 
                                    contract="SimpleAdd.IService" 
                                    name="netTcpBinding_IService" /> 
            </client> 
            <services> 
                <service name="SimpleAdd.Service" 
                                 behaviorConfiguration="SimpleAddMEXBehavior">  
                    <!-- Enable the MEX endpoint --> 
                    <endpoint address="mex" 
                                        binding="mexTcpBinding" 
                                        contract="IMetadataExchange" /> 
                    <host> 
                        <!-- Need to add this so MEX knows the address of our service. --> 
                        <baseAddresses> 
                            <add baseAddress="http://localhost:8731/Design_Time_Addresses/SimpleAdd/Service/" /> 
                        </baseAddresses> 
                    </host> 
                </service> 
            </services> 
            <behaviors> 
                <serviceBehaviors> 
                    <behavior name="SimpleAddMEXBehavior">  
                        <serviceMetadata httpGetEnabled="true" /> 
                    </behavior> 
                </serviceBehaviors> 
            </behaviors> 
        </system.serviceModel> 
    </configuration> 
    So, where have I gone wrong?
    Rod

    Hello Richard,
    Well, I've tried making the change to the MEX point for net.tcp, but now when I try to start the service I get the following error in the event log:
    Service cannot be started. System.InvalidOperationException: Service 'SimpleAdd.Service' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
    I am sure the problem lies with what I've put into the app.config file.  My app.config file now looks like this:
    <?xml version="1.0" encoding="utf-8" ?> 
    <configuration> 
        <system.serviceModel> 
            <client> 
                <endpoint address="" 
                                    binding="netTcpBinding" 
                                    contract="SimpleAdd.IService" 
                                    name="netTcpBinding_IService" /> 
            </client> 
            <services> 
                <service name="SimpleAdd.Service" 
                                 behaviorConfiguration="SimpleAddMEXBehavior">  
                    <!-- Enable the MEX endpoint --> 
                    <endpoint address="mex" 
                                        binding="mexTcpBinding" 
                                        contract="IMetadataExchange" /> 
                    <host> 
                        <!-- Need to add this so MEX knows the address of our service. --> 
                        <baseAddresses> 
                            <add baseAddress="net.tcp://localhost/SimpleAdd" /> 
                        </baseAddresses> 
                    </host> 
                </service> 
            </services> 
            <behaviors> 
                <serviceBehaviors> 
                    <behavior name="SimpleAddMEXBehavior">  
                        <serviceMetadata httpGetEnabled="false" /> 
                    </behavior> 
                </serviceBehaviors> 
            </behaviors> 
        </system.serviceModel> 
    </configuration> 
    I've also tried using this for the <client> tag under <system.serviceModel>:
    <client> 
       <endpoint address="net.tcp://localhost/SimpleAdd" 
             binding="netTcpBinding" 
        contract="SimpleAdd.IService" 
        name="netTcpBinding_IService" /> 
    </client> 
    But that gives me the same error in the event log.
    So, what have I done wrong now?
    Rod

  • How to find out the tables that will be affected using a transaction

    Hi,
    How to find out the list of database tables that will be affected when we use a standard transaction(ex. VA01, MM01..)...?(like When we create a salesorder, which tables and which fields will be affected..?)
    Is there any transaction or a simple way to find out the solution?
    Thanks,
    Pradeep.

    Hi,
    Give transaction code and in menu(system- status),  double click onthe Program name.
    Check in TOP INCLUDE - you will find all the tables related to that transaction.
    Thanks,
    Anitha

  • Is there a way to find the temporary table that are created or read during?

    Hi All,
    I'm working on performance optimization where I have to find the temporary tablespaces that are created or read during runtime? Is there any way to find it?
    Can you please also tell me how the temporary tables are created? And after each run time whether the data is getting deleted or the whole table is getting deleted?
    Whether these tables are created only during runtime? What are the naming conventions for all the temporary tables that are created?
    Is the table creation has anything to do with Delta or Full load?
    Regards,
    Kartik

    Stephen Tyler Bloom wrote:
    When they come out with the next garageband, they should add that feature .
    be sure to let Apple know:
    http://www.bulletsandbones.com/GB/GBFAQ.html#sendfeedback
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Find record in table - HELP

    Hy,
    I have the following situation: i have a table,(for eg. emp -id, name,...) and i want to create a form which allowes me to add,modify and delete records. That is not hard but the problem is that i do not want to see the records sequentially but i want to go to a specific record in the table(eg id=79) and modify that.
    Can you help me please? This is for my thesis at university.
    Thank you

    hi~
    1.try create 1 text item(non db item) eg. :blk01.id
    2.set your db block property 'DEFAULT_WHERE' with sql
    eg. ID like NVL(:blk01.id,'%')
    after compile the form ,you can run form and specific
    id to :blk01.id or not ,after query executed,if you
    specificed id ,you can get what record you want ,else
    you will get all records ..

  • How to retrieve data from a table that match values in a varray?

    Using - Oracle 10g Release 1.2
    How to do write a sql to retrieve data matching values in a varray?
    I have the following:
    declare
        v_ct          NATURAL := 0;
        type t_cur is  REF CURSOR;
        v_cursor t_cur;
        TYPE t_array IS VARRAY(100) OF NUMBER;
        l_codes t_array := t_array();
    begin
        select count(*)
          into v_ct
          from table1
         where ind_cd IS NULL;
        IF v_ct = 0 THEN
            l_codes(1) := 1;
        END IF;
        select count(*)
          into v_ct
          from table2
         where cd IS NULL;
        IF v_ct = 0 THEN
            l_codes(2) := 2;
        END IF;  
       OPEN v_cursor for
          select * from error_table where error_cd in (SELECT * FROM TABLE(CAST(l_codes AS t_array)) );
    end;

    This may not answer your question, but what about a pure SQL solution?
    NOTE THIS IS UNTESTED:
    SELECT *
    FROM     ERROR_TABLE
    WHERE     ERROR_CD IN
              SELECT      1
              FROM      table1
              HAVING      COUNT(*) > 0
              UNION ALL
              SELECT      2
              FROM      table2
              HAVING      COUNT(*) > 0     
         )HTH!

  • How do I find all the tables that are used by an application component?

    .

    Hi ,
                Goto SE93, then pull down the Transactioncode field then select  SAPApplications. Then you will get all the T-codes application wise. Then try to analyze the tables used by the T-codes.
    Regards,
    Hari.
    Edited by: Hariprasad K on Mar 31, 2008 6:40 PM

  • Need to find records which match or unmatch with isd code

    Hi all,
    Having two tables
    1. cdr
    callingno                      calledno
    9891567854                 8613548159929
    9894562145                 8125642136545
    9899546213                 8336547896322
    8856521217                 8174456217789
    2. ISD rates
    code
      81
    817
    818
    819
       82
       84
    850
    852
    853
    8536
    855
      86
    Requirements:
    1] Matching records : Find records from cdr which matches isd code from isd rates table
    it cound be
    select cdr.callingno, cdr.calledno from cdr cdr, isdrates isd where (( substr(cdr.calledno,1,1) =isd.code) or ( substr(cdr.calledno,1,2) =isd.code) or ( substr(cdr.calledno,1,3) =isd.code) or
    ( substr(cdr.calledno,1,4) =isd.code))
    output:
    callingno                      calledno
    9891567854                 8613548159929
    9894562145                 8125642136545
    8856521217                 8174456217789
    2] Unmatching records:
    output required:
    callingno                      calledno
    9899546213                 8336547896322
    Kindly Help.

    this?
    with cdr(callingno,calledno) as (
    select '9891567854','8613548159929' from dual union all
    select '9894562145','8125642136545' from dual union all
    select '9899546213','8336547896322' from dual union all
    select '8856521217','8174456217789' from dual ),
    isd(code) as(
    select '81' from dual union all
    select '817' from dual union all
    select '818' from dual union all
    select '819' from dual union all
    select '82' from dual union all
    select '84' from dual union all
    select '850' from dual union all
    select '852' from dual union all
    select '853' from dual union all
    select '8536' from dual union all
    select '855' from dual union all
    select '86' from dual )
    select q.callingno,
           q.calledno,
           case when count(decode(m, 'MATCHED', 1)) > 0 then 'MATCHED' else 'UNMATCHED' end
      from (select t.callingno,
                   t.calledno,
                   case when (substr(t.calledno, 1, 4) like i.code || '%') then 'MATCHED' else 'UNMATCHED' end m
              from cdr t, isd i) q
    group by q.callingno, q.calledno
    CALLINGNO
    CALLEDNO
    CASEWHENCOUNT(DECODE(M,'MATCHE
    9899546213
    8336547896322
    UNMATCHED
    8856521217
    8174456217789
    MATCHED
    9891567854
    8613548159929
    MATCHED
    9894562145
    8125642136545
    MATCHED
    Ramin Hashimzade

  • How to find out which table store historical data for V_T001B?

    dear all,
    how i want to trace and find out which table that store all maintenance data history from V_T001B?
    thanks.

    i already find out into both table... but the data not store there...

  • How to Find out PSA Table

    Hi Gurus,
    I need to know how can i find out the name of the PSA Table in one request...i mean, i need to view the PSA Table...but i dont know which is the table name of that request.
    THanks a lot !!

    hi Tin,
    in your case, you can edit the psa request by go to monitor of that request, and there is button 'psa'.
    click it and choose package (if more than 1).
    to check all psa request, rsa1->psa->locate your infosource/datasource and expand.
    to find psa table name, you can try right click your infosource and 'show data flow', and set technical name on,
    in data flow screen, you will find /bic/b000xxx table,
    that's the psa table.
    hope this helps.

  • Request - The table that stores various variables (modifiable)

    Hi,
    I am trying to find the standard table that stores various variables in the SAP system and is modifiable. I think it starts with a "T" but I can't be sure.
    Please help.
    Thanks,
    John

    I think you are talking about TVARV
    TVARV is  Table of variables in selection criteria .
    Hope this helps
    Vinodh Balakrishnan

  • Reg : Find the records  in Table control

    Dear all
    Im having one requirement in table control .  In my table control totally 100 records contains sales documents
    for Example
    100010
    100020
    100030
    In that Records how to find particluar sale document in table control. How to build find option in table control.
    If possible or not
    Thanks & regards
    Sri

    Hi Sridhar,
    You need to implement amodal screen for this and a Find button above the table control.
    or you can use POPUP_GET_VALUES FM
    after you enter a value in the POP up screen.
    " You need to put some effort to implement this, wish you to implement it successfully as this is possible
    READ TABLE ITAB WITH KEY VBELN = FIND_VBELN. " FIND_VBELN is the field on your find screen.
    if sy-subrc = 0.
    tc-top_line = sy-tabix. " this makes the record visible in the First position
    endif.
    PROCESS AFTER INPUT.
      LOOP AT itab.
        MODULE find.
      ENDLOOP.
    In Program
    MODULE find INPUT.
      DATA : tab TYPE STANDARD TABLE OF sval WITH HEADER LINE.
      REFRESH tab.
      CASE ok_code.
        WHEN 'FIND'.
          clear ok_code.
          tab-tabname = 'VBAK'.
          tab-fieldname = 'VBELN'.
          APPEND tab.
          CALL FUNCTION 'POPUP_GET_VALUES'
            EXPORTING
    *   NO_VALUE_CHECK        = ' '
              popup_title           = 'Find Sales Order'
       start_column          = '5'
       start_row             = '5'
    * IMPORTING
    *   RETURNCODE            =
            TABLES
              fields                = tab
    EXCEPTIONS
       error_in_fields       = 1
       OTHERS                = 2
          IF sy-subrc = 0.
            READ TABLE itab WITH KEY vbeln = tab-value.
            IF sy-subrc = 0.
              tc-top_line = sy-tabix.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " find  INPUT
    Cheerz
    Ram

  • Using JOIN to two tables to find records NOT in second table...

    I always seem to get these types of queries wrong and need a bit of help:
    I have a table of relationships called MARKETER_ACCOUNT and another table of pending relationships called ACCOUNT_ENROLLMENT.
    I have accounts that can be enrolled with a MARKETER. They enter the ACCOUNT_ENROLLMENT table as Pending and on a certain Effective Date the go active and then move to the MARKETER_ACCOUNT table. If a relationship ends, it can end by either enrolling with another Marketer or if no pending enrollment they are assumed to be going back to the parent company.
    So I want to find all the records that came back to the parent company (i.e. they should not have a pending record in the ACCOUNT_ENROLLMENT table but have an end date in the MARKETER_ACCOUNT table:
    Select * from MARKETER_ACCOUNT M
    where M.account_no NOT IN (select E.account_no from ACCOUNT_ENROLLMENT E
    where E.effective_date between '08-DEC-2009' and '07-JAN-2010')
    and M.expiration_date between '08-DEC-2009' and '07-JAN-2010';
    This query is still running and I'm not sure where I am going wrong. I want to say GIVE me all the accounts in the MARKETER_ACCOUNT table that have an expiration date between '12/07/2009' and '01/07/2010' and where those accounts are NOT pending in the ACCOUNT_ENROLLMENT table where the effective date is for the same period.
    Any help would be greatly appreciated.
    Sean

    You could possibly try the NOT EXISTS version of the query:
    SELECT  *
    FROM    MARKETER_ACCOUNT M
    WHERE   NOT EXISTS
                    SELECT  NULL
                    FROM    ACCOUNT_ENROLLMENT E
                    WHERE   M.ACCOUNT_NO = E.ACCOUNT_NO
                    AND     E.EFFECTIVE_DATE BETWEEN TO_DATE('08-DEC-2009','DD-MON-YYYY') AND TO_DATE('07-JAN-2010','DD-MON-YYYY')
    AND     M.EXPIRATION_DATE BETWEEN TO_DATE('08-DEC-2009','DD-MON-YYYY') AND TO_DATE('07-JAN-2010','DD-MON-YYYY');Otherwise check out these threads:
    {message:id=1812597}
    {thread:id=863295}

Maybe you are looking for

  • VisualReportsSaveCube project 2013 user defined fields not available

    Hi all, when buildung the cube without vb I can access all userdefined fields in the report.7 When I use the VisualReportsSaveCube method no userdefined fields are in the cube. What is going wrong? Goal is to build an Excelreport showing Resource Uti

  • Some signs arent working on my HP Pavilion G6

    Hello everyone, Ive got a problem. Within i think a week my Laptop stops using some signs. Such as ' " ` ^ ~. Please help me. I REALLY dont know how to fix it. Here are my Laptop specifications, if needed: HP Pavilion G6 Notebook PC Keyboard Version:

  • How do I set up PayPal Standard?

    I have been through the tutorial and the help files, but, I keep getting an 'invalid vendor account'. I only want to use Standard, but originally set up PayPal PayFlow, which is in the settings. Not sure what to do to clear out PayFlow and just use S

  • WebLogic Server 10.3.3: What's new?

    Hi, Where can I read about what's new in 10.3.3 WL version? Regards Ricardo

  • Alert notification for down light weight access point?

    Hello! Is there a way to get a notification when a lightweight access point goes down? I recently introduced WiSM in my wireless LAN and keeping track of the access point status is a challenge. Thanks in advance!