SQL query SUM and AVG

Hi all,
I think I'm being really stupid but I'm having SQL query issues.
I have a table with lots of lines of transactions which all refer to different stores, for example:
Store..............._Sales_............._Month_
Reading............200k..............April
Leeds...............50k................April
Manchester........70k................May
Reading............100k..............May
I need to come up with the average Sales for the combined months as a total. I.e. the average Store revenue for a given period is 200k+ 50k + 70k +100k / *3* (As there are only 3 unique stores) - hopefully this makes sense!
So essentially I am trying to do both a SUM query (and grouping by store) and then outputting the average of all stores together. Is this possible?
Thank you,

Hello,
This query returns 140 what seems to be the correct value:
with data as
( select 'Reading' Store
  , 200 sales
  from dual
  union
  select 'Leeds'
  , 50
  from dual
  union
  select 'Manchester'
  , 70
  from dual
  union
  select 'Reading'
  , 100
  from dual
select sum(sales)
, count( distinct store )
, sum(sales)/count(distinct store)
from dataThere are multiple options:
1. You can get two IR's on one page (by using IFRAMEs - search for that word on the Forum)....
2. You create another region with the query above and position that just below the report
3. In the Region Footer call a PL/SQL process (using AJAX) that calculates the value using the query and prints it there (using htp.p)
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/
You can award this reply to your question by marking it as either Helpful or Correct ;-)

Similar Messages

  • SQL Query clauses and conditions

    Hi,
    I wanna to get the entire conditions specified in the SQL query to do a specific treatement on them.
    in fact, i want to do a syntaxical analyse on the query.
    If there is a specific table where query in stored is seperate clauses, objects invoked, conditions used,..., please let me know.
    elsewhere, il you have a PL/SQL program that do that, it'll be wonderfull.
    Best regards;

    thank for your reply, but what i need is not the query text, but the seperated query clauses and conditions.
    best regards

  • How to get sql query data and write into csv file?

    I am writing to seek help, in how can I create bat. script which can execute the following logic:
    connection to the database
    run sql query
    create CSV file
    output query data, into CSV file
    save the CSV file
    osql
    -S 84.18.111.111
    -U adw
    -P rem
    -i "c:\query.sql"
    send ""
    sed -e 's/,\s\+/,/g' MCI_04Dec2014.csv > localNoSpaces.csv
    -o "c:\MCI_04Dec2014.csv"
    This what i have so far, and I am little struggling with the logic after creating CSV file. I am unable to get the above script to work, please advice further, where I may be going wrong. 
    Can you create if statement logic within window's script, to check for null parameters or data feeds?
    Any hints would be most appreciated. 

    Thank you for your reply. 
    Apology for posting the code irrelevant to the forum, as I am still novice scripting user.  
    My goal is to create window's script which can compute the above logic and send the final output file (csv), to FTP folder. 
    Can this logic be implemented via bat. script, if so, is there a example or tutorial i could follow, in order to achieve my task. 
    Any help would be much appreciated. 

  • SQL query - combining AND and OR

    I am just tweaking a page here:
    http://www.goodsafariguide.net/africanhorseback/index102.php
    Basically just changing the nominations history part to just show nominations from 2013 and 2011, as some of the palces had too long a list of nominations.
    So the original SQL query was:
    SELECT NominationID, Category, Year, Finalist, Winner, LodgeID FROM nominations WHERE LodgeID = 288 ORDER BY Year DESC, CATEGORY ASC
    So I want it to now display nominations for that LodgeID, but just for 2011 and 2013, which I thought should just be:
    SELECT NominationID, Category, Year, Finalist, Winner, LodgeID FROM nominations WHERE LodgeID = 288 AND (Year='2013' OR '2011') ORDER BY Year DESC, CATEGORY ASC
    But that isn't working. I've tried a few variations, with and without the inverted commas, but can't seem to get it.
    Any suggestions?

    Try this:
    SELECT NominationID, Category, Year, Finalist, Winner, LodgeID FROM nominations WHERE (Year='2013' OR Year='2011') AND LodgeID = '288' ORDER BY Year DESC, CATEGORY ASC
    if you wanted a run of years like 2011 , 2012 and 2013 you could use:
    SELECT NominationID, Category, Year, Finalist, Winner, LodgeID FROM nominations WHERE Year BETWEEN '2011' AND '2013' AND LodgeID = '288' ORDER BY Year DESC, CATEGORY ASC

  • SQL query automation and output to text file

    The bcp utility should handle this task pretty easily for you. The documentation is available here.

    I know enough SQL to get me by with the few things I currently do in it (but would always like to know and do more).  Anyway, I was just recently asked if I could come up with a way to automate the execution of a SQL query we currently manually run, and then have the results of that query output (instead of to the screen in SSMS) to a text file with the ".dat" extension.  I've never automated a SQL query before nor have I had the results output to a file.  Can anyone give me some pointers on how to tackle this?
    The query currently calls to a stored procedure (which does all the work) and just executes it with some given dates from the query so I'm thinking the output will need to come from the stored procedure (and the code for output to a file added there?)
    This topic first appeared in the Spiceworks Community

  • Exclude NULL values from SUM and AVG calculation

    Hi,
    I have column in report that contains some NULL values. When i perform SUM,MAX,MIN or AVG calculation on this column the NULL values are treated as '0' and included in calculation. Is there any way to exclude them while calculating aggregate functions? 
    As a result MIN calculation on values (NULL,0.7,0.5,0.9) gives me output as 0 when it should have been 0.5 
    Can someone please help ?
    Thanks and Regards,
    Oliver D'mello

    Hi Oliver,
    According to your description, you want to ignore the NULL values when you perform aggregation functions.
    In this scenario, aggregate functions always ignore the NULL values, because their operation objects are non-null values. So I would like to know if you have assigned “0” for NULL values. I would appreciate it if you could provide some screenshots about
    your expressions or reports.
    Besides, we have tested in our environment using  Min() function. The expression returns the minimum value among the non-null numeric values. Please refer to the screenshots below:
    Reference:
    Min Function (Report Builder and SSRS)
    Aggregate Functions Reference (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • Sql Query : Sum , all the possible combination of rows in a table

    SQL Server 2008 R2
    Sample Table structure
    create table TempTable
    ID int identity,
    value int
    insert into TempTable values(6)
    insert into TempTable values(7)
    insert into TempTable values(8)
    insert into TempTable values(9)
    insert into TempTable values(10)
    I actually want something like below,
    that It returns rows such that, it has the sum of all the remaining rows , as shown below.
    I will ignore the repeated rows.
    6+7
    6+8
    6+9
    6+10
    6+7+8
    6+7+9
    6+7+10
    6+8+9
    6+8+10
    6+9+10 
    6+7+8+9
    6+7+8+9+10

    This makes no sense. What about NULLs? What about duplicate values? You have rows, so you have many combinations. We know that this set totals to 39, so there is no subset totals to half of any odd number.  19.5
    in this case. 
    None of your examples are
    even close! 
     6+7 = 13
    the remaining rows 8+9+10 = 27, so you failed! 
    Want to try again?
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • [SQL] Query Sum

    Hi all, hope in your help.
    This is my table:
    +----+--------+--------+
    | id | field1 | field2 |
    +----+--------+--------+
    |  1 | A1     | 7      |
    |  2 | B1     | 9      |
    |  3 | C1     | 0      |
    |  4 | D1     | 3      |
    |  5 | A2     | 5      |
    |  6 | B2     | 6      |
    |  7 | C2     | 7      |
    |  8 | D2     | 8      |
    +----+--------+--------+I need this output:
    +--------+--------------------+
    | field1 | field2             |
    +--------+--------------------+
    | A2     | 19.230769230769200 |
    +--------+--------------------+
    | B2     | 23,076923076923100 |
    +--------+--------------------+
    | C2     | 26,923076923076900 |
    +--------+--------------------+
    | D2     | 30,769230769230800 |
    +--------+--------------------+and tried this query
    where calculate the value of single field1 (5,6,7,8) divided by the sum of field2 equal to A1, B2, C2 and D2 (26) :
    A = 5/26 * 100 = 19
    B = 6/26 * 100 = 23
    C = 7/26 * 100 = 26
    D = 8/26 * 100 = 30
    SELECT
         field1,
         field2/Sum(field2)*100 as field2
    FROM
         `tbl_t`
    WHERE
         1
    AND field1 IN ('A2', 'B2', 'C2', 'D2');
    +--------+--------------------+
    | field1 | field2             |
    +--------+--------------------+
    | A2     | 19.230769230769234 |
    +--------+--------------------+But the ouput is not what I want, can you help me?
    Thank you
    Any help would be greatly appreciated.
    Edited by: user13264840 on 25-mag-2013 10.33

    WITH data AS
      ( SELECT 1 id , 'A1' Field1 , 7 Field2 FROM dual
    UNION ALL
       SELECT 2 , 'B1' , 9 FROM dual
    UNION ALL
       SELECT 3 , 'C1' , 0 FROM dual
    UNION ALL
       SELECT 4 , 'D1' , 3 FROM dual
    UNION ALL
       SELECT 5 , 'A2' , 5 FROM dual
    UNION ALL
       SELECT 6 , 'B2' , 6 FROM dual
    UNION ALL
       SELECT 7 , 'C2' , 7 FROM dual
    UNION ALL
       SELECT 8 , 'D2' , 8 FROM dual
      Group_data AS
      (SELECT  id ,
        field1    ,
        field2    ,
        SUBSTR ( field1 , regexp_instr ( field1 , '[1234567890]' ) ) groupBy
          FROM data
      SELECT  Field1 ,
       ratio_to_report ( field2 ) over ( partition BY groupby ) * 100 "Field2"
         FROM group_data;

  • Sql query : sum of feild between two conditional date

    hi
    I have a table whit 3 field like below. I want to Find the
    total number of hours in mode "run" after the latest mode "decoke".
    field time is for every day and its unique.
    id -- time  --  mode -- hour
    1  --1/1/1 -- run  --  24
    2  -- 1/1/2  -- off  -- 24
    3  -- 1/1/3  decoke  -- 24
    4  -- 1/1/4  -- run  -- 24
    5  -- 1/1/5  -- run -- 24
     this query should add row 4 and 5 , the latest "run" after "decoke"

    Create table #temp
    [id] int identity(1,1)
    , [time] date
    , [mode] varchar(50)
    , [hour] int
    Insert into #temp
    Select '1/1/1' , 'run' ,24
    Union
    Select '1/1/2' , 'off' ,24
    Union
    Select '1/1/3' , 'decoke' ,24
    Union
    Select '1/1/4' , 'run' ,24
    Union
    Select '1/1/5' , 'run' ,24
    -----Here is the Query-------
    ;With Cte_TotalTime
    As
    Select Max(time)[Time] from #temp Where mode = 'decoke'
    Select SUM(a.hour) TotalRunHours from #temp a
    Inner join Cte_TotalTime b on a.[time] > b.[Time]
    And mode = 'run'
    Drop table #temp
    Please mark as answer if it is helpful to you.
    Thanks

  • SQL query editor and "like" with a parameter (can't get it to work).

    I've been following all sorts of directions on how to use mysql a table and modifying the query to accept a parameter, funny thing is no matter how I try to construct the simplest query, the query editor does not parse the query properly when using the "LIKE" statement.
    Using 3.11 and/or 3.12 of the J/connector with no success.
    I am using a query that resembles the following:
    select all table.fieldname, table.fieldname2 from tablename where table.fieldname like '%?%'
    It parses correctly but the code when run can not find the parameter as it reports the number of paramenters as being incorrect.
    I have tried these varriations of the "like" statement.
    '%?%' - expected this to work, it parses correctly but errors out claiming invalid number of parameters.
    %?% - without quotes causes parsing errors.
    '?' - parses correctly but isn't the correct query.
    ? - again without quotes causes parsing errors,even if it did it isn't the correct query.
    If I set the query to use a value instead of a parameter - it works fine.
    Hints? Suggestions? Bug?
    Thanks in advance.

    Hmm, try use
    select ... like ?
    And path this kind of string as the parameter to your query
    String findCriteria = "what you are looking for";
    String parameter = "'%" + findCriteria + "%'";Roman.

  • SQL query with AND or OR

    Hi,
    I am trying to get a recordset that samples multiple columns of my Access database for filtering, rather than just one.  I looked at a few .asp websites and they say the query would be written like this:
    SELECT SystemName, SystemCategory, Branch, Manufacturer
    FROM UnmmannedAircraftSystems
    WHERE Branch LIKE %MMColParam%
    AND PerfSensorPayloads LIKE %MMColParam2%
    ORDER BY SystemName ASC
    but it never works.  The page fails on the server.  And I know this type of query works through straight .asp coding, but somehow the way Dreamweaver sets up the variables is killing it.
    Anybody have an ideas?
    MW

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!--#include file="../../Connections/BleahBleahBleahhhhh" -->
    <%
    Dim RSfilterRec__MMColParam
    RSfilterRec__MMColParam = "1"
    If (Request.Form("BranchesUsedby") <> "") Then
      RSfilterRec__MMColParam = Request.Form("BranchesUsedby")
    End If
    %>
    <%
    Dim RSfilterRec__MMColParam2
    RSfilterRec__MMColParam2 = "1"
    If (Request.Form("SensorPay") <> "") Then
      RSfilterRec__MMColParam2 = Request.Form("SensorPay")
    End If
    %>
    <%
    Dim RSfilterRec
    Dim RSfilterRec_cmd
    Dim RSfilterRec_numRows
    Set RSfilterRec_cmd = Server.CreateObject ("ADODB.Command")
    RSfilterRec_cmd.ActiveConnection = MM_ConnUASdata_STRING
    RSfilterRec_cmd.CommandText = "SELECT SystemName, SystemCategory, Branch, Manufacturer FROM UnmannedAircraftSystems WHERE Branch LIKE ? AND PerfSensorsPayloads LIKE ? ORDER BY SystemName ASC"
    RSfilterRec_cmd.Prepared = true
    RSfilterRec_cmd.Parameters.Append RSfilterRec_cmd.CreateParameter("param1", 200, 1, 255, "%" + RSfilterRec__MMColParam + "%") ' adVarChar
    RSfilterRec_cmd.Parameters.Append RSfilterRec_cmd.CreateParameter("param2", 200, 1, 255, "%" + RSfilterRec__MMColParam2 + "%") ' adVarChar
    Set RSfilterRec = RSfilterRec_cmd.Execute
    RSfilterRec_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    Repeat1__numRows = 10
    Repeat1__index = 0
    RSfilterRec_numRows = RSfilterRec_numRows + Repeat1__numRows
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <style type="text/css">
    <!--
    body  {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
    background: #666666;
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    color: #000000;
    /* Tips for Elastic layouts
    1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
    2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
    3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
    .thrColEls #container {
    width: 46em;  /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
    background: #FFFFFF;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 1px solid #000000;
    text-align: left; /* this overrides the text-align: center on the body element. */
    /* Tips for sidebar1:
    1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
    2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width.
    3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColEls #sidebar1 p" rule.
    .thrColEls #sidebar1 {
    float: left;
    width: 11em; /* since this element is floated, a width must be given */
    background: #EBEBEB; /* top and bottom padding create visual space within this div */
    height: 1200px;
    padding-top: 15px;
    padding-right: 0;
    padding-bottom: 15px;
    padding-left: 0;
    .thrColEls #sidebar2 {
    float: right;
    width: 11em; /* since this element is floated, a width must be given */
    background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
    padding: 15px 0; /* top and bottom padding create visual space within this div */
    height: 1200px;
    .thrColEls #sidebar1 h3, .thrColEls #sidebar1 p, .thrColEls #sidebar2 p, .thrColEls #sidebar2 h3 {
    margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
    margin-right: 10px;
    height: 100%;
    /* Tips for mainContent:
    1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
    2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div.  No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
    3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
    4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
    .thrColEls #mainContent {
      margin: 0 12em 0 12em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */
    /* Miscellaneous classes for reuse */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
    clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    -->
    </style><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .thrColEls #sidebar1, .thrColEls #sidebar2 { padding-top: 30px; }
    .thrColEls #mainContent { zoom: 1; padding-top: 15px; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]--></head>
    <body class="thrColEls">
    <div id="container">
      <div id="sidebar1">
        <h3> </h3>
        <!-- end #sidebar1 --></div>
      <div id="sidebar2">
        <h3> </h3>
        <!-- end #sidebar2 --></div>
      <div id="mainContent">
        <h1> 
          <table border="1">
            <tr>
              <td>ID</td>
              <td>SystemName</td>
              <td>SystemCategory</td>
              <td>Branch</td>
              <td>Manufacturer</td>
              <td>Status</td>
              <td>Inventory</td>
              <td>PlatformCost</td>
              <td>SystemCost</td>
              <td>PlannedBuyToDate</td>
              <td>PlannedBuyYear1</td>
              <td>PlannedBuyYear1Quantity</td>
              <td>PlannedBuyYear2</td>
              <td>PlannedBuyYear2Quantity</td>
              <td>PlannedBuyYear3</td>
              <td>PlannedBuyYear3Quantity</td>
              <td>PlannedBuyYear4</td>
              <td>PlannedBuyYear4Quantity</td>
              <td>PlannedBuyYear5</td>
              <td>PlannedBuyYear5Quantity</td>
              <td>PlannedBuyYear6</td>
              <td>PlannedBuyYear6Quantity</td>
              <td>PlannedBuyYear7</td>
              <td>PlannedBuyYear7Quantity</td>
              <td>PlannedBuyYear8</td>
              <td>PlannedBuyYear8Quantity</td>
              <td>PlaformOperationPicLink</td>
              <td>OrthoDrawingLink</td>
              <td>Capability</td>
              <td>BackgroundSysDescrip</td>
              <td>SystemDescription</td>
              <td>CharLength</td>
              <td>CharWingSpan</td>
              <td>CharGrossWgt</td>
              <td>CharPayloadWgt</td>
              <td>CharEngines</td>
              <td>CharFuelWgtType</td>
              <td>DataLinks1</td>
              <td>DataLinks2</td>
              <td>DataLinks3</td>
              <td>Frequencies1</td>
              <td>Frequencies2</td>
              <td>Frequencies3</td>
              <td>PerfEndurance</td>
              <td>PerfRadius</td>
              <td>PerfCeiling</td>
              <td>PerfAirspeeds</td>
              <td>PerfTakeoff</td>
              <td>PerfLanding</td>
              <td>PerfSensorsPayloads</td>
              <td>PerfSensorModels</td>
              <td>PayloadCharInternalSize</td>
              <td>PayloadCharInternalWgt</td>
              <td>PayloadCharInternalPwr</td>
              <td>PayloadCharInternalEnv</td>
              <td>PayloadCharExternalSize</td>
              <td>PayloadCharExternalWgt</td>
              <td>PayloadCharExternalPwr</td>
              <td>PayloadCharExternalEnv</td>
            </tr>
            <% While ((Repeat1__numRows <> 0) AND (NOT RSfilterRec.EOF)) %>
              <tr>
                <td><%=(RSfilterRec.Fields.Item("ID").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("SystemName").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("SystemCategory").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Branch").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Manufacturer").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Status").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Inventory").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlatformCost").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("SystemCost").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyToDate").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear1").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear1Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear2").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear2Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear3").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear3Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear4").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear4Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear5").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear5Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear6").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear6Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear7").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear7Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear8").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlannedBuyYear8Quantity").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PlaformOperationPicLink").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("OrthoDrawingLink").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Capability").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("BackgroundSysDescrip").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("SystemDescription").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("CharLength").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("CharWingSpan").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("CharGrossWgt").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("CharPayloadWgt").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("CharEngines").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("CharFuelWgtType").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("DataLinks1").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("DataLinks2").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("DataLinks3").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Frequencies1").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Frequencies2").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("Frequencies3").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfEndurance").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfRadius").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfCeiling").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfAirspeeds").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfTakeoff").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfLanding").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfSensorsPayloads").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PerfSensorModels").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharInternalSize").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharInternalWgt").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharInternalPwr").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharInternalEnv").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharExternalSize").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharExternalWgt").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharExternalPwr").Value)%></td>
                <td><%=(RSfilterRec.Fields.Item("PayloadCharExternalEnv").Value)%></td>
              </tr>
              <%
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      RSfilterRec.MoveNext()
    Wend
    %>
          </table>
        </h1>
        <!-- end #mainContent --></div>
    <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
    <!-- end #container --></div>
    </body>
    </html>
    <%
    RSfilterRec.Close()
    Set RSfilterRec = Nothing
    %>

  • SQL Query : sum only numbers in row - need help

    Pls see data below. I would like to display only 8 rows and BRH CCN rows should be merged together and displayed as - BRH 98 2 instead of 2 rows. The rest of the rows should remain as is. Please help.
    CCN     SERVICES     MANUFACTURING
    ASL     138     NA
    BRH     98     NA
    BRH     NA     2
    C10000     NA     0
    C40000     NA     0
    DAO     NA     10
    E10000     NA     0
    I10000     NA     0
    M10000     NA     0
    Edited by: auxilia on Nov 7, 2009 6:25 AM

    with t as (
               select 'ASL' ccn,'138' services,'NA' manufacturing from dual union all
               select 'BRH','98','NA' from dual union all
               select 'BRH','NA','2' from dual union all
               select 'C10000','NA','0' from dual union all
               select 'C40000','NA','0' from dual union all
               select 'DAO','NA','10' from dual union all
               select 'E10000','NA','0' from dual union all
               select 'I10000','NA','0' from dual union all
               select 'M10000','NA','0' from dual
    select  ccn,
            nvl(max(case services when 'NA' then null else services end),'NA') services,
            nvl(max(case manufacturing when 'NA' then null else manufacturing end),'NA') manufacturing
      from  t
      group by ccn
    CCN    SERVICES             MANUFACTURING
    E10000 NA                   0
    C10000 NA                   0
    BRH    98                   2
    M10000 NA                   0
    C40000 NA                   0
    ASL    138                  NA
    I10000 NA                   0
    DAO    NA                   10
    8 rows selected.
    SQL>   SY.
    Edited by: Solomon Yakobson on Nov 7, 2009 6:46 AM

  • Executing the sam SQL Query again and again on the same records?

    Hi currently we have a system that will compute certain charge information base on a file finance department send to us from another system
    The problem is that their file contains of Account with bank records and account with no bank records.
    for thos account with bank records it will just send to us and we will just update it..and those account will be updated...
    but for those account that have no bank records ..it will send to us again and again..and these no bank records account will accumulate
    the finance department mention that there is not much they can do on their side except sending us the file
    is there any gd solution for this people kind to share?

    Well one simple solution which i can think of is to persist Non-bank accounts in a Serializable Object and save it in a temporary cache.
    Now before running a query on them and then trying to update the database checkout the peristed cache, check whether data records exist their or not
    if they do, dont update that records in the database.
    or define your database tables in such a way that there is an indication of abt bank & non-bak records and write a query / procedure in such a way that it do not update the duplicate non-bank records.
    Hope this might help :)
    REGARDS,
    RaHuL

  • Sql query obitype and sys acct

    Does B1 assign "obitype" and "sys account" _sysxxxxxxxxxx automatically?  What does each mean and feature?

    Dear Lily,
    The objtype is an id representation of each document type used in SBO.
    Eg.
    13 - AR Invoice related document
    203 - AR Downpayment Invoice
    14 - AR Credit Memo
    18 - AP Invoice related document
    and so on... you should be able to find a document called "How to Interpret Transaction Type Abbrieviations" from the SAP portal documentation page.
    The account code SYS_0000XXXXXX you find the in the JDT table is also a representation id for the various accounts in your Chart of Accounts. This format of account id is used, ecause the Chart of Accounts used in your company database is of type 'Account Segmentation'. To find the relevant Account Code (as defined in your Chart of Accounts) for this segementation id SYS_0000XXXXXX, link this value to the 'Code' column of the OACT table.
    Hope it helps.
    Warmest Regards,
    Chinho

  • Can we change/Modify BI server generated Sql query and run to fetch data

    Hi,
    My client is saying that there is an option to modify bi server generated sql query to fetch data from source.
    question:As a request is made in presentation services, A dynamic sql query is generated and fetches data from source. all this is loggedin Nqlquery log..well can we change/modify the sql query generated and run modified sql query to fetch data from source. ., if so how? if not why?
    Thanks in advance
    Edited by: user10794468 on Jun 16, 2009 6:29 PM
    Edited by: user10794468 on Aug 12, 2009 6:58 PM

    Thank you so much for your reply..
    ..Can we also modify sql query generated by bi server to fetech data. the query's which we see in query log file..

Maybe you are looking for

  • Event 4999 - Watson report about to be sent for process id: 27244 on Mailbox Server every five minutes

    On one of my DAG enabled Exchange 2013 mailbox servers, I get this error in event viewer every five minutes: Log Name:      Application Source:        MSExchange Common Date:          6/25/2014 10:49:46 AM Event ID:      4999 Task Category: General L

  • IPad keeps freezing

    My iPad is less than a year old, and suddenly it's freezing -- can't even turn it off, for several minutes.  Just now I got it off, rebooted it, and then it froze again.  Why?!?

  • Display Progress Indicator in the Run Time

    Hi All, How do display Progress Indicator in the Run Time for a JSF Page using ADF components? Regards Santosh

  • Why does print function in Preview with Lion OS not work?

    Since upgrading to Lion, the print functionality on Preview does not work.  When you select Print, the rainbow wheel of misfortune appears and I have to force quit Preview after a while. The print window does not even appear to select a printer (I ha

  • How can i get appointment frame in OutLook

    Hi All, I got OutLook but OutLookExpress .by using Runtime.getRuntime().exec("cmd /c start outlook"); i got inbox, outbox ...by using Runtime.getRuntime().exec("cmd /c start outlook:inbox"); In this outlook how do we get the appointment frame and new