Fifo method inventory valuation sql query.

Dear all,
I want to stock valuation by FIFO method. if some one have any solution please give me advise.
thanks

You won't get any answers with a question like that...
What is "to stock valuation by FIFO method"?
Give us an example.

Similar Messages

  • ReportViewer using SQL Query error states: Incorrect syntax near ','.

    Hello Community
        Using Visual Studio 2008 and SQL Server 2008 I created a Windows Application
    that uses SQL Server Reporting Services.  The application uses ReportViewer and
    calls a method written using SQL query.
                1-First I created the form.
                2-Next I dragged the ReportViewer (Toolbox) and Table (from DataSource) onto the form.
    The problem is that when it reaches the last line of the SQL query (ie, da.Fill(ds, "TableOne");)
    the code fails stating the error message:
                "Incorrect syntax near ','."
         The following is the code behind the form containing the query:
            private void ReportPgm1_Load(object sender, EventArgs e)
                // TODO: This line of code loads data into the 'ReportDBDataSet.TableOne' table. You can move, or remove it, as needed.
                this.TableOneTableAdapter.Fill(this.ReportDBDataSet.TableOne);  
                reportViewer1.ProcessingMode = ProcessingMode.Local;
                LocalReport ReportOneLocalReport = reportViewer1.LocalReport;
                DataSet ds = new DataSet("ReportDBDataSet.TableOne");
                pgmReportOne(FromDate, ToDate,   ds);
                ReportDataSource ds = new ReportDataSource("ReportDBDataSet.TableOne");
                ds.Value = dataset.Tables["TableOne"];
                ReportOneLocalReport.DataSources.Clear();
                ReportOneLocalReport.DataSources.Add(ds);
                this.reportViewer1.RefreshReport();
            private void pgmReportOne(DateTime FromDate, DateTime ToDate, DataSet ds)
                SqlConnection connection = new SqlConnection("Data Source=ReportDBServer;Initial Catalog=ReportDB;Uid=sa;pwd=Password");
                string sqlReportOne = "Select ([InDate], [FirstName], [LastName], [AGe]" +
                                   "from TableOne";
                SqlCommand command = new SqlCommand(sqlReportONe, connection);
                command.Parameters.Add(new SqlParameter("paramFDate", FromDate));
                command.Parameters.Add(new SqlParameter("paramTDate", ToDate));
                SqlDataAdapter da = new SqlDataAdapter(command);
                da.Fill(ds, "TableOne");
        Why does the last line throw an error?
        Thank you
        Shabeaut

    --NOTE: The statement below cannot be run on SQL Server 2012
    --If you have an earlier version and can set the compatibility
    --level to 80, it can be run.
    SELECT sso.SpecialOfferID, Description, DiscountPct, ProductID
    FROM Sales.SpecialOffer sso,
    Sales.SpecialOfferProduct ssop
    WHERE sso.SpecialOfferID *= ssop.SpecialOfferID
    AND sso.SpecialOfferID != 1
    Hi Scott
    The *= is old syntax and not compatible with SQL Server 2012 (as stated in the comments). 
    You could do something like this instead
    SELECT sso.SpecialOfferID
    ,Description
    ,DiscountPct
    ,ProductID
    FROM Sales.SpecialOffer sso
    left outer join Sales.SpecialOfferProduct ssop on sso.SpecialOfferID = ssop.SpecialOfferID
    WHERE sso.SpecialOfferID != 1

  • Inventory Valuation by FIFO method.

    Hi All,
         We need to know if it is possible to get any report where in we can know what would the inventory valuation be if inventory is to be valued by FIFO method. Currently the valuation method is moving average. We need this for year end purpose only. We do not want to post any entries or change the existing valuation of the inventory for any of the items. We only need a simulation report for Inventory valuation by FIFO method. Is there any way we can get such a report??
    Thanks,
    Pritesh.

    Hi,
         Thanks for the quick reply. I have configured FIFO valuation method and tried on the test server. I have the following 2 questions in it:
    1) When executing MRF1, there is an error while creating the Batch Input session.
        bdc_close_group, session not opened
          message no. 00330
    2) If the session does get created, as per my understanding if the session is processed, system executes the Tcode MR22 in background and postings take place as
    Inventory account    -    DR
    Revaluation account  -  CR.
       My doubt is that, will this change the existing valuation of the Inventory ? We do not want to change the existing valuation.
    Thanks,
    Pritesh.

  • FIFO in pl/sql query or procedure

    Hi,
    I have two tables:
    1)Table of recieved items
    create table receipts
    (item_id number(5),
    recieved_date date,
    recieved_quantity number,
    receipt_id number(5));
    insert into receipts(item_id, recieved_date, recieved_quantity, receipt_id)
    values(668, '29/12/10', 400, 441);
    insert into receipts(item_id, recieved_date, recieved_quantity, receipt_id)
    values(668, '29/12/10', 100, 442);
    insert into receipts(item_id, recieved_date, recieved_quantity, receipt_id)
    values(668, '03/02/11', 150, 444);2)Table of sold items
    create table deliveries
    (item_id number(5),
    delivered_date date,
    delivered_quantity number,
    delivery_id number(5));
    insert into deliveries(item_id, delivered_date, delivered_quantity, delivery_id)
    values(668, '01/02/11', 10, 1301);
    insert into deliveries(item_id, delivered_date, delivered_quantity, delivery_id)
    values(668, '02/02/11', 450, 1303);
    insert into deliveries(item_id, delivered_date, delivered_quantity, delivery_id)
    values(668, '08/02/11', 15, 1305);
    insert into deliveries(item_id, delivered_date, delivered_quantity, delivery_id)
    values(668, '09/02/11', 90, 1306);I need to track down from which batch goods are taken (for each delivery) using FIFO method.
    FIFO priorities are RECIEVED_DATE, RECEIPT_ID for INs and DELIVERED_DATE, DELIVERY_ID for OUTs.
    Desired output should be something like this:
    {noformat}
    ITEM_ID          DELIVERED_DATE  DELIVERED_QUANTITY      DELIVERY_ID     FROM_RECEIPT    STOCK_QUANTITY(*)
    668          01/02/11     10               1301          441          390
    668          02/02/11     390(**)               1303          441          0
    668          02/02/11     60(**)               1303          442          40
    668          08/02/11     15               1305          442          25
    668          09/02/11     25(**)               1306          442          0
    668          09/02/11     65(**)               1306          443          85
    {noformat}(*)Where STOCK_QUANTITY is the remaining quantity from that batch at the moment after according delivery amount deduction.
    (**)If the delivery gets the goods from different batches, the row should be split to display the amount taken from each batch.
    How can I make pl/sql query/procedure to track down this?
    Any help is very appreciated.
    DB version is: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    Thank you,
    Nikita

    Hi, Nikita,
    Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful.
    Use the analytic SUM functuion to get a running total of how much has been receeived and delivered to date. I did this in the sub-queries deliveries_rt and reciepts_rt:
    WITH     receipts_rt     AS
         SELECT     item_id
         ,     received_date
         ,     received_quantity
         ,     SUM (received_quantity) OVER ( PARTITION BY  item_id
                                        ORDER BY          received_date
                                    ,               receipt_id
                                  )      AS received_total
         ,     receipt_id
         FROM    receipts
    ,     deliveries_rt     AS
         SELECT     item_id
         ,     delivered_date
         ,     delivered_quantity
         ,     SUM (delivered_quantity) OVER ( PARTITION BY  item_id
                                         ORDER BY      delivered_date
                                     ,                delivery_id
                                  )      AS delivered_total
         ,     delivery_id
         FROM    deliveries
    SELECT       d.item_id
    ,       d.delivered_date
    ,       LEAST ( received_total  + delivered_quantity - delivered_total
                , delivered_total + received_quantity  - received_total
              , delivered_quantity    -- *****  See correction, below  *****
              )          AS delivered_quantity
    ,       d.delivery_id
    ,       r.receipt_id          AS from_receipt
    ,       GREATEST ( received_total - delivered_total
                   , 0
                 )          AS stock_quantity
    FROM       deliveries_rt     d
    JOIN       receipts_rt     r  ON     d.item_id        = r.item_id
                        AND     d.delivered_total  > r.received_total  - r.received_quantity
                      AND     r.received_total   > d.delivered_total - d.delivered_quantity
    ORDER BY  d.item_id
    ,            d.delivered_date
    ,       d.delivery_id
    ,            r.received_date
    ,       r.receipt_id
    ;What role does item_id play in this problem? I made a guess, but guessing isn't a very good way to solve problems.
    It may help to think of each row as having a low running total (or low_rt, the total quantity up to, but NOT including the current row) and a high running total (high_rt, the total qualntity up to AND including the current row). In the sub-queries above, I only computed the high_rt, since it's easy enough to get the low_rt from that by subtraction.
    Each row in the deliveries table will be joined to a row in the receipts table if the running totals overlap, that is, if the high_rt of each row is greaterr than the low_rt of the other.
    Delivered_quantity is the minimum of the high_rt from either table minus the low_rt of the other, but it can never be greater than the delivered_quantity.
    Edited by: Frank Kulash on Mar 3, 2011 10:06 AM
    Brief explanation added.
    Edited by: Frank Kulash on Apr 23, 2013 12:56 PM
    <H3>Correction</H3>
    The computation of delivered_quantity in the main query should have 1 more argument to LEAST, like this:
    ,       LEAST ( r.received_total  + d.delivered_quantity - d.delivered_total
                , d.delivered_total + r.received_quantity  - r.received_total
              , d.delivered_quantity
              , r.received_quantity               -- ***  Added  ***
              )          AS delivered_quantityThanks to Jean Marie Delhaze ( {message:id=10980754} below) for finding and correcting my mistake.

  • Difference between Inventory Valuation Methods...

    Hi
    Can any say how does the 3 Inventory Valuation Methods Suits for the business Process...names FIFO for what kind of Businesses and Standard & Moving Average so on...
    If any links to learn ...please let me know it....
    Thanks

    Hi Gopi,
    Check below:
    Moving Average– the method is based on the calculation of an average cost for the item in each sales and purchasing transaction.
    Standard– the standard pricing system permits the selection of a fixed price, which is then used for all transactions.
    FIFO– an additional perpetual inventory system, in which goods purchased first are sold first, regardless of the actual goods flow.
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Error in "Inventory Valuation Method using Moving Average"

    Dear Sir,
    Here I am using moving average as inventory valuation method at one of my client. I want to know that in SAP Business One, in case of F.G. valuation we can only get the valuation of Raw Material and not the direct expenses cost.
    Can you please tell me how should i put the Direct Expense Cost (e.g. Labor Rate) in F.G. inventory Valuation?
    Please reply ASAP.
    Thanks & Regards
    SS

    Hi,
    Only the raw material cost will be added to the Cost of the FG based  on the Quantity and price in the BOM.
    Ex:
    To make Parent Item FG 1 nos , you required 2 nos of Child Item of Rs 10 each,
    Create Bom for the same and refresh the cost of the FG (will find a refresh arrow in the Bottom of the BOM -Screen)
    Once you Issue child parts to the respective production order and make  a receipt for the Parent Item the cost of the FG will be posted as RS 20
    If you want to add the labor cost to the FG there is no direct provision to add the cost in SBO, we have give a work around only as follows.
    Create a Service  Item ex.Labor Cost and give the Standard cost for that Item in inventory tab For example for Rs 200/Hr
    Now add the Service item (Labor Cost) in the Bill of material and in the Quantity field  give the Time for the labor required is if the Labor Time taken is 30 min to make 1 FG give 0.5 ie (convert the cycle time to Hours and give the decimal value)
    then refresh the BOM,
    Now the cost of the FG will be 20+100( labor cost) = 120
    The above method can be used only if you have determined a standard time of labor to manufacture,
    With regards,
    G.Eshvanth Singh

  • Inventory Valuation Method

    HI,
    My client has the requirement like comparison of Item with  different valuation method in a single report.
    Is there any provision to do this.
    Please suggest
    Regards,
    Vikram

    Dear Vikram,
    Inventory Valuation Method is inteneded as a managerial report to check what-if scenarios. For instance, you can see what happens if you value an item based on a different costing method. This report is not intended to be used as report for auditing. For audititng purposes use the Inventory Audit Report.
    You can use any standard method for the inventory valuation. You can also define various criteria to restrict the selection for inventory valuation.
    Goto Inventory->Inventory Report->Inventory Valuation Report.
    You will have to export to excel and consolidate the results.
    Please note It can be run for other costing methods than actually selected for an item. For the selected method of valuation for an item, please run Inventory Audit Report. Exporting will work for you.
    Regards
    Preety Goel
    SAP Business One Forums Team

  • FIFO Inventory valuation without Balance Sheet Valuation

    Our business wants to know if they can have real-time FIFO inventory valuation;
    At a give point, When we perform and update the material prices through the Balance sheet Valuation - FIFO procedure; system automatically revaluates the inventory at FIFO with offsetting to an expense account.
    However, the requirement is to have FIFO real time without performing any month end tasks/ postings to calculate and update the material prices.
    Given that the existing material price controls (S and V); Is the above possible ?
    With Material Ledger; some of the standard functionalities can be leveraged i,e to have one valuation for std/ actual and the other to have FIFO valuation but the business thinks this is too much of an effort to maintain this functionality. Since, even for this option - the business has to run month end jobs.
    Thanks !

    Hi
    Real time FIFO valuatopn is some thing which would require ML...
    however, there are companies who valuated the inventory based on FIFO at period end w/o any use of ML...
    I am not very sure as I have never used it - But using MRN9 you can have a comparison of inventory values as per the 2 principles and if you tick "Update Database", it would post to the books....
    Please await further replies from the forum members on this...
    br,Ajay M

  • Modes and Methods in Tag Query and SQL Query

    Hi,
    Can someone explain me about the modes available in <b>TAG Query and SQL Query.</b>
    TAG Query has modes such as <b>Current, CurrentWrite, GroupList, History, HistoryEvent, ModeList, Statistics and TagList</b>
    SQL Query i still have doubt on <b>FixedQuery with output , Modelist and TableList</b>
    I also need to know why methods are used?
    Thanks in advance
    Regards
    Muzammil

    I'll try to  explain to the best of my knowledge :
    <u><b>TagQuery</b></u>
    <b>Current</b> : Gives you the current value of the Tag you are reading.
    <b>CurrentWrite</b> : Let you write a Value as the Current Value of the Tag.
    <b>GroupList</b> : Generally Tags are grouped under different groups. Returns you the name of the Groups.
    <b>From the xMII Help Document :</b>
    <b>History</b> : History Mode returns interpolated data.  Interpolation can be accomplished by specifying either the # of rows desired or the retrieval resolution.  If the mode is "History" and a value is provided for the Resolution parameter (which is in seconds), the connector will retrieve evenly-spaced values starting at the beginning of the time interval, up to the maximum # of rows specified in the RowCount parameter.  If no value is provided for the Resolution parameter, the connector will return an evenly-spaced number of values based on the value of the RowCount parameter.
    For example, if the time interval is 1 hour, Resolution is 15, and RowCount is 240, the connector will return evenly spaced values each 15 seconds, up to 240 values (which would span the entire hour).
    If the time interval is 1 hour, Resolution is not provided or is set to zero, and RowCount is 120, the connector would return 120 evenly spaced values, at an effective interval of 30 seconds.
    <b>HistoryEvent Mode</b> : The connector can provide historical values "as they were stored" the database.  This mode provides no interpolation of values.
    <b>Statistics Mode</b> : When retrieving data for statistical calculations, the connector utilizes the same techniques as in the "HistoryEvent"  mode.  It is important to note that the first two returning columns in the HistoryEvent query must be the timestamp and the value, in that order.  The SAP xMII Statistical processor expects that order, or errors will occur.  This ensures precision of statistical measurements, particularly time-weighted average, by using the exact storage time and values from the historical database.  The SAP xMII system provides the statistical calculations.
    <b>Modelist</b> : Basically returns the modes of the Query Available. The Data returned is same as the data in the Modes list in the Quert Template Editor.
    <b>Taglist</b> : Returns all the Tags in the Datasource.
    <u><b>SQL Query</b></u>
    <b>Modelist</b> : Same as above.
    <b>TableList</b> : List of all the tables in the database to which the connector connects.
    Again from SAP xMII Help Documentation :
    <b>FixedQueryWithOutput</b> : This mode is used to execute an Oracle stored procedure or function that returns a REF CURSOR as output.  The position of the REF CURSOR is marked by a "?" in the query.  For example:
    <b>Create a table.</b>
    <i>create table usage (id int, name varchar(50));
    insert into usage (id, name) values (1, 'test1');
    insert into usage (id, name) values (2, 'test2');
    insert into usage (id, name) values (3, 'test3');
    insert into usage (id, name) values (4, 'test4');
    insert into usage (id, name) values (5, 'test5');
    insert into usage (id, name) values (6, 'test6');
    insert into usage (id, name) values (7, 'test7');
    insert into usage (id, name) values (8, 'test8');</i>
    <b>Define the stored procedure.</b>
    <i>DROP PACKAGE foopkg;
    CREATE PACKAGE foopkg IS
      TYPE cursortype is ref cursor;
      PROCEDURE test (mycursor in out cursortype);
    END foopkg;
    CREATE PACKAGE BODY foopkg IS
      PROCEDURE test (mycursor in out cursortype) AS
      BEGIN
         open mycursor for select * from usage;
      END;
    END foopkg;
    </i>
    Define a query template for calling the stored procedure.  Enter the following in the FixedQuery tab:
    <b>call foopkg.test(?)</b>
    This template returns all rows from the Usage table.

  • DRQ: Specific Identification Method for Inventory Valuation

    This is a request to incorporate the features of Specific Identification Method (or Actual Cost) of Inventory Valuation for Serial Number / Batch Number controlled items.
    Found lots of threads in the Forum regarding this topic, but could not able find out any answer from SAP.
    Sometimes back, myself posted the same thread, but got reply that Navision has this features please use that.
    Hope SAP Team has enough knowledge about this method of valuation, that is why I am not giving any example.
    If require I can provide enough example on this topic.
    Thanks & Regards
    Anjan Bhowmick

    Hi Peter,
    This is the same requirement we need in mexico. What do you mean with "Next major releases"?
    In other words, this requirement is not going to be consider for next version 8.8?
    Waiting for your response.
    Elías

  • Inventory valuation in SAP IS retail

    Hi SAP gurus,
    Anybody  please help me to configure inventory valuation in SAP IS retail.
    I have little knowledge in Joint valuation and split valuation in MM.
    May I follow the same procedure for SAP IS retail also or else, help me for the same.
    Expecting answers ASAP.
    Regards,
    Logi

    Hi Venu
    All of us are aware that the inventory valuation method — such as FIFO, LIFO, or Averaging — has an impact on the business’s profit margin.
    I am only aware that the following Standard Functions have not been tested with Articles in SAP Retail:
    Plant maintenance (PM)
    Subcontracting with generic articles
    LIFO and FIFO analysis
    Production planning (PP-PI)
    Using serial numbers with generic articles
    Project System (PS)
    The caveat coming out of the fact above is to ensure sure that these functions work correctly in your project.
    Still looking for more information on any constraints of using LIFO FIFO for SAP Retail.

  • SQL Query Help Needed

    I'm having trouble with an SQL query. I've created a simple logon page wherein a user will enter their user name and password. The program will look in an Access database for the user name, sort it by Date/Time modified, and check to see if their password matches the most recent password. Unfortunately, the query returns no results. I'm absolutely certain that I'm doing the query correctly (I've imported it directly from my old VB6 code). Something simple is eluding me. Any help would be appreciated.
    private void LogOn() {
    //make sure that the user name/password is valid, then load the main menu
    try {
    //open the database connection
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:LawOffice2000", "", "");
    Statement select = con.createStatement();
    String strTemp = "Select * From EMPLOYEES Where INITIALS = '" + txtUserName.getText() + "' Order By DATE Desc, TIME Desc";
    ResultSet result = select.executeQuery(strTemp);
    while(result.next()) {
    if (txtPassword.getPassword().toString() == result.getString("Password")) {
    MenuMain.main();
    else {
    System.out.println("Password Bad");
    System.out.println(txtUserName.getText());
    System.out.println(result.getString("Password"));
    break; //exit loop
    //close the connection
    con.close(); }
    catch (Exception e) {
    System.out.println("LawOfficeSuite_LogOn: " + e);
    return; }
    }

    The problem is here: "txtPassword.getPassword().toString() == result.getString("Password"))"
    Don't confuse String's equals() method with the equality operator '=='. The == operator checks that two references refer to the same object. If you want to compare the contents of Strings (whether two strings contain the same characters), use equals(), e.g. if (str1.equals(str2))...
    Example:String s1 = "foo";
    String s2 = new String("foo");
    System.out.println("s1 == s2: " + (s1 == s2)); // false
    System.out.println("s1.equals(s2): " + (s1.equals(s2))); // trueFor more information, check out Comparison operators: equals() versus ==

  • How to execute a sql query in VO????

    Hi every body.
    Can you show me the way to execute a sql query in VO.
    For example: I have a viewobject1, and I add a new method void execSQL() before the last '}' of the java file of viewobject1 like this:
    public void execSQL() {
    String strSql = "Select sysdate from dual";
    I want to execute strSql query and return a Resultset, how can I perform ???
    Thanks a lot.

    The executeQuery method in ViewObjectImpl does not return a ResultSet.
    ViewObjectImpl voImpl;
    voImpl.setQuery(strSql);
    voImpl.executeQuery();

  • PL/SQL function body returning SQL query - ORA-06502: PL/SQL: numeric or value error

    I'm attempting to dynamically generate a rather large SQL query via the "PL/SQL function body returning SQL query" report region option.  The SQL query generated will possibly be over 32K.  When I execute my page, I sometimes receive the "ORA-06502: PL/SQL: numeric or value error" which points to a larger than 32K query that was generated.  I've seen other posts in the forum related to this dynamic SQL size limitation issue, but they are older (pre-2010) and point to the 32K limit of the DNS (EXECUTE IMMEDIATE) and DBMS_SQL.  I found this post (dynamic sql enhancements in 11g) which discusses 11g no longer having the 32K size limitation for generating dynamic SQL.  Our environment is on 11gR2 and using ApEx 4.2.1.  I do not know which dynamic SQL method -- DNS or DBMS_SQL -- ApEx 4.2.1 is using.  Can someone clarify for me which dynamic SQL method ApEx uses to implement the "PL/SQL function body returning SQL query" option?
    As a test, I created a page on apex.oracle.com with a report region with the following source:
    declare
      l_stub varchar2(25) := 'select * from sys.dual ';
      l_sql  clob := l_stub || 'union all ';
      br     number(3) := 33;
    begin
      while length ( l_sql ) < 34000 loop
        l_sql := l_sql || l_stub || 'union all ';
      end loop;
      l_sql := l_sql || l_stub;
      for i in 1 .. ceil ( length ( l_sql ) / br ) loop
        dbms_output.put_line ( dbms_lob.substr ( l_sql, br, ( ( i - 1 ) * br ) + 1 ) );
      end loop;
      return l_sql;
    end;
    The dbms_output section is there to be able to run this code in SQL*Plus and confirm the size of the SQL is indeed larger than 32K.  When running this in SQL*Plus, the procedure is successful and produces a proper SQL statement which can be executed.  When I put this into the report region on apex.oracle.com, I get the ORA-06502 error.
    I can certainly implement a work-around for my issue by creating a 'Before Header' process on the page which populates an ApEx collection with the data I am returning and then the report can simply select from the collection, but according to documentation, the above 32K limitation should be resolved in 11g.  Thoughts?
    Shane.

    What setting do you use in your report properties - especially in Type and in Region Source?
    If you have Type="SQL Query", then you should have a SELECT statement in the Region Source. Something like: SELECT .... FROM ... WHERE
    According to the ERR-1101 error message, you have probably set Type to "SQL Query (PL/SQL function body returning SQL query)". In this situation APEX expects you to write a body of a PL/SQL function, that will generate the text of a SQL query that APEX should run. So it can be something like:
    declare
    mycond varchar2(4000);
    begin
    if :P1_REPORT_SEARCH is not null THEN
    mycond:='WHERE LAST_NAME like :P1_REPORT_SEARCH ||''%''';
    end if;
    return 'select EMPLOYEE_ID, FIRST_NAME, LAST_NAME from EMPLOYEES ' ||mycond;
    end;
    And for escaping - are you interested in escaping the LIKE wildcards, or the quotes?
    For escaping the wildcards in LIKE function so that when the user enters % you will find a record with % and not all functions, look into the SQL Reference:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm
    (You would than need to change the code of your function accordingly).
    If you are interested in escaping the quotes, try to avoid concatenating the values entered by the user into the SQL. If you can, use bind variables instead - as I have in my example above. If you start concatenating the values into the text of SQL, you are open to SQLInjection - user can enter anything, even things that will break your SQL. If you really need to allow users to choose the operator, I would probably give them a separate combo for operators and a textfield for values, than you could check if the operator is one of the allowed ones and create the condition accordingly - and than still use bind variable for inserting the filtering value into the query.

  • Last Result from Fulltext SQL Query Search Not Showing

    I am creating a custom search results page for MOSS 2007 (using inline .aspx code - don't ask) that uses Fulltext SQL Queries.  I get the results in a ResultTable (see code below) and then use a DataTable to write code to display it (I could have used
    a DataGrid, I know).
    The problem is that the last result is not showing. So, if it reports that there are 5 results, only 4 will show. I have verified that all 5 results do exist (using a slightly broadened query). If it reports 1 result, none exist in the DataTable that loads
    the result data from the ResultTable.
    FullTextSqlQuery query = new FullTextSqlQuery(site);
    query.ResultTypes = ResultType.RelevantResults;
    query.QueryText = qry;
    query.RowLimit = 50;
    query.StartRow = iPage;
    try
    ResultTableCollection results = query.Execute();
    ResultTable resultTable = results[ResultType.RelevantResults];
    DataTable table = new DataTable();
    table.Load(resultTable, LoadOption.OverwriteChanges);
    int n = resultTable.TotalRows;
    The variable "qry" is a valid SQL Query with the relevant clauses.
    I am using a foreach loop to go through "table" (a DataTable), and so I do not think that I have a "one-off error".
    Any suggestions would be most welcome.

    So in results you have all items but when you are loading it into table (type DataTable) you are loosing one last record.
    1) First you check what data you are getting in resultTable - as you are specifying RelevantResult
    2) Check last index of data in ResultTable collection and try to find out the last index ResultTable, or try to find last index of data in result table
    DataTable.Load method accepts parm of type IDataReader and IDatareader, there are cases it looses records if not read properly..check below links
    http://stackoverflow.com/questions/8396656/why-does-my-idatareader-lose-a-row
    http://msdn.microsoft.com/en-us/library/system.data.datatable.load(v=vs.110).aspx
    <hr> Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL <br/> <b><a href="http://insqlserver.com">Everything about SQL Server | Experience inside SQL Server </a></b>-<a href="http://insqlserver.com">Mohammad
    Nizamuddin </a>

Maybe you are looking for

  • Decision Step In Work flow

    Hi Workflower's Thanks a lot for all your reply! I'm having one problem in Decision step when work item is generated and placed under SAP inbox while user select particular work item then decision option "Choose one of the following alternatives" App

  • Sender and Receiver IDOC config Settings

    Guys I have just come up with this document as a quick reference guide to enable me to be able to configure IDOC scenarios quickly and efficiently. Couls you please let me know if this looks ok and all is in the correct order. <u>Quick Guide to Scena

  • Problem in delevering an email to the recipent inbox using BEx Broadcaster.

    Hi Gurus, I was trying to send an e-mail with output format(HTML,PDF,EXCEL etc)  using BEx Braodcaster wizard - Whenever I press execute in BI 7.0 BEx Broadcaster wizard after giving e-mail adress, contents, and subject the session is closing and it

  • Cracking and popping so

    Hey I am running the latest drivers. I have a X-Fi Fataty. and i am running Vista 64 bitAny one else getting VERRY BAD stuttering, cracking, and popping sounds in games?Titan quest for example on the main menu is COMPLETLY HORRIBLEWorld of Warcraft i

  • Adobe form to replace smartform in SRM 7

    Hello, We are in the process of utilizing the adobe server for form processing in our SRM 7 environment. In SRM 5.0 we have some custom Z smartforms for SRM documents. I am having the following questions: 1) What are the steps to do a "smoke test" to