Query with Consecutive Dates in results

I have a table like this:
queue data_date volume
2324 09-01-01 353
2324 09-01-03 34
2324 09-01-04 43
2325 09-01-01 53
2325 09-01-02 66
i want to have output like this:
queue data_date volume
2324 09-01-01 353
*2324 09-01-02 0*
2324 09-01-03 34
2324 09-01-04 43
2325 09-01-01 53
2325 09-01-02 66
Note the filled in 09-01-02 date.
What I'm doing now is using a pipelined table function that iteratates through the date range executing a select for each date and doing a piped output. A bit slow but faster than old solution below.
I've also did set operations using a single query that contains unions and minuses. This proved to be slow.
The only thing I haven't tried is to have a stored proc popuate the 0 for the missing date.
Is there another way to do this that's efficient?
I'm using a 10g database but soon the data will be ported to an 11g.

Welcome to the forums!
I would say one of the best ways on most recent versions of Oracle would be to use the PARTITION OUTER JOIN.
See the following link for examples/explanation: partition outer join in oracle 10g

Similar Messages

  • BAM Data Control - Group query with Active Data Service

    Trying to get a group query from a BAM data control to work with Active Data Service in an ADF application (JDeveloper 11.1.1.4.0).
    With a flat query, as the data changes, I can see DataChangeEvents fired, resulting in a data push to the client -
    <BAMDataChangeEventFilter> <log>
    #### DataChangeEvent #### on [DataControl name=CEP_Person_DOB_Flat, binding=data.view_mainPageDef.FlatDOB1.view_pageDefs_FlatDOBViewPageDef_WEB_INF_FlatDOB_xml_FlatDOB.QueryIterator]
    Filter/Collection Id : 1966
    Collection Level : 0
    Event Id : 5
    ==== DataChangeEntry (#1)
    ChangeType : INSERT_AFTER
    KeyPath : [2157, 0]
    InsertKeyPath : [null, 0]
    AttributeNames : [id, _PersonKey, _County, _Surname, _AGE, _DOB, _Country, _FirstName]
    AttributeValues : [2157, 10008/129, Vagzukarbsm, Gnnfzxxyqfgpsijcr, 110, Thu Dec 26 00:00:00 GMT 1901, Ekcqvrkoksr, Vwhm]
    When I try a group query on the same data, currently just trying to group by _DOB for every 10 years to count the number of people, I get no data change events fired, so don't get any data pushed to the client, though the data has been changed if I refresh the page.
    Any ideas ?

    can you include bam and jdev versions and also include exception from logs?

  • Query with a condition - Overall results row displays incorrect value

    Hi All,
    I have a bw query with top 40 conditions. However, The Overall Result Row Figures Do Not Equal The Sum of the Column Rows.
    Although the top condition is activated, the overall result still displays the overall result of the whole report.
    I have 3 columns in the report
    Selected Period
    Prior Period and
    Variance
    The formula for variance is (Selected Period/Prior Period)-1.
    Does anyone have an idea to fix this?
    Thank you so much in advance.
    Have a great day!

    Hi Gaurav,
    Thank you so much for your reply, however this does not solve fully the issue.
    Changing the properties to "Summation" will indeed provide me with the correct sum for the "selected period" and "Prior Period." However what I need in the Overall Result Row for the "Variance" column is not the total but instead the value when the total of Selected Period is divided by Prior Period then minus 1.
    Overall Variance = (Overall Selected Period/Overall Prior Period)-1
    Do you know a way to make this possible.
    Thank you so much.

  • Date Query With Restricted Dates

    Sorry not really an easy thing to explain:
    I have specified in a Query that i Only want values with a date BETWEEN:
    01JAN2002 08:00 AND 01SEP2003 08:00
    Now in the same query, what is the simplest way to restrict that only the following dates are examined and not all the dates within the above time window:
    Say 06/01 - 07/01
    The following dates i am looking to analyze will thus be
    01JUN2002 08:00 - 01JUL2002 08:00
    01JUN2003 08:00 - 01JUL2003 08:00
    Thanks

    Had a little bit more time to test, today. So in case you couldn't find the complete soultion yourself, here you go. The records with flag='Y' are the ones that fit within your selection criteria (between any 7-OKT 8:00AM and 8-OKT 8:00AM).
    drop table testDate;
    create table testDate(id number,flag char,yourDate date);
    insert into testDate values (1,'Y',to_date('7-OKT-2003 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (2,'Y',to_date('8-OKT-2003 7:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (3,'N',to_date('7-OKT-2003 3:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (4,'N',to_date('8-OKT-2003 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'Y',to_date('7-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'N',to_date('6-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'N',to_date('9-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    commit;
    select id,flag,to_char(yourDate,'DD-MON-YYYY HH:MI:SS') from testDate
    where trunc(yourDate,'HH')-trunc(yourDate,'YYYY')
    between to_date('7-OKT-2003 08:00:00','DD-MON-YYYY HH:MI:SS')-to_date('01-JAN-2003')
    and to_date('8-OKT-2003 08:00:00','DD-MON-YYYY HH:MI:SS')-to_date('01-JAN-2003')
    /

  • Error when executing Query with user date settings = mm/dd/yyyy

    Hi all,
    I created a remote cube with datasource = TCURR table with proper conversion of the date etc.
    The query on top of this remote cube works fine if my user date settings is set to dd.mm.yyyy
    But when a user in USA, with user date settings = mm/dd/yyyy, executes the same query, they get a message
    SYST: Date 31/05/2006 not expected.
    Message no. FGV004
    The input variable on the Query is on 0CALMONTH.
    This message appears immaterial of what calmonth input I give.
    has anyone encountered this error? if yes, what could be the solution please?
    thanks
    Emmanuel

    Hi,
    This is in regard to the user settings maintained in transaction /nsu3.Please follow the below link.
    http://web.mit.edu/sapr3/docs/webdocs/getstarted/gsSETTINGS.html
    You need to change the settings as required.
    Hope this helps.
    Thank you,
    Prem

  • Query with Top N Condition (Result Row)

    Hi,
    I made a query with an active top n condition. The query has 2 Keyfigures and 1 formula
    Gross-sales acutal | Gross-sales previous year | Previous Year %
    So that to result line is correct, I had to say "Calculate result as summation" for the keyfigures
    gross sales actual and gross sales previous year. That works.
    I have the problem with my formula. the formular for previous year % is defined as follows:
    gross sales actual %A gross sales previous year
    Example Top 3 Customer
                        gross sales actual          gross sales prev. year         prev. year %
    Cust 1          100                                   80                                       125 %
    Cust 2          90                                     45                                        200 %
    Cust 3           80                                    60                                        133 %
    Result          270                                   185                                       142.8 % ( 350 * 100 / 245 )
    The result of 142 % is the correct result without the condition top 3. with the top 3 condition
    the result should be 270 * 100 / 185 = 145.9 %
    Additional customer without top 3 condition
    Cust 4          50                                       40                                        125 %
    Cust 5          30                                        20                                        150 %
    It shows the correct result for each single line. The result in the result row is wrong. it is calculated
    without taking the active condition. the formular calculates
    with the total gross sales actual and the total of gross sales prev. year.
    is there any solution the achieve the correct % in the result row?
    thanks for your help.
    Pascal

    Pascal,this is a known behavior with conditions.When you apply condition it just hide the extra rows and it does not impact the result row.So your result row actually shows the value irrespective of the condition you apply.
    Now with the help of local functions like calculate result as summation you can show the correct sum after applying the condition but when you try to use that result in some calculation then it takes the original value thereby discarding the calculated value.
    Same is happening in your case as well.Its taking the original value i.e 350 and not the calculated sum after condition i.e 270.
    Hope this helps.
    Regards,
    AL

  • Simple query with like return wrong result

    Hi,
    I run simple query with like.
    If I use parameter I get wrong results.
    If I use query without parameter results are ok.
    My script:
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    -- drop table abcd;
    create table abcd (col1 varchar2(10));
    INSERT INTO ABCD VALUES ('122222');
    insert into abcd values ('111222');
    SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
    COL1
    122222
    *111222*
    select * from abcd where col1 like '12%'; -- result ok
    COL1
    122222
    I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    and query run in Oracle SQL Developer 3.1.07.

    Hi,
    welcome to the forum.
    When you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should specify exactly how you run your code.
    If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
    Session altered.
    SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    Session altered.
    SQL>
    SQL> -- drop table abcd;
    SQL> create table abcd (col1 varchar2(10));
    Table created.
    SQL>
    SQL> INSERT INTO ABCD VALUES ('122222');
    1 row created.
    SQL> insert into abcd values ('111222');
    1 row created.
    SQL>
    SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
    SP2-0552: Bind variable "1" not declared.
    SQL>
    I got this error. So I wonder how you set value 12%
    Please specify exactly how you run your test as we cannot reproduce your problem.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can I send a post query with attached data using Labview?

    Hi,
    I need to send data (a file of 5KB) to a php server.
    In order to do it, I need to send a post request with attached data.
    I'm using Labview 6.1 and I have the Internet Toolkit.
    But I just see the Get Method. Isn't implemented the post method in Labview?
    Thanks for your help
    Best regards

    Hi,
    In order to use the POST request method as opposed to the GET request method I used a VI set up as shown in the attached GIF.
    From the front panel you need to provide values for the 3 inputs. "Bytes to read" is an arbitrarily large number that meets or exceeds the maximum number of bytes you expect as a response from your server. "Address" is just the URL of the server, e.g. "10.90.1.1" or "localhost" or "www.google.com". "Data in" is the actual request you're sending with the data included.
    "Data in" would be in a format similar to everything in the quotes below (important to have 2 carriage returns to finish the request);
    POST /phppage.php HTTP/1.1
    Content-Length: ??
    Host: http://www.mywebserver.com
    Content-Type: application/x-www-form
    -urlencoded
    email=[email protected]&password=mypassword
    For sending your data file you just have to set the requisite MIME-type and then include the file data in place of the form data in the example above.
    Hope this helps,
    Neil
    Attachments:
    LV_TCP_code.gif ‏4 KB

  • VStest.console.exe Query for a Data Row Result DURING Test Execution Status

    I started with the following
    thread and was asked to create a new thread. 
    I have the following test that reads a .csv as a data source.
    /// <summary>
    /// Summary description for Test
    /// </summary>
    [TestCategory("LongTest"),
    TestCategory("Visual Studio 2013"), TestMethod]
    [DeploymentItem("data.csv")]
    [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV",
    "|DataDirectory|\\data.csv",
    "data#csv",
    DataAccessMethod.Sequential),
    DeploymentItem("data.csv")]
    public void Create_And_Build_All_Templates()
    testmethodname = "Create And Build All Templates ";
    LaunchVisualStudio2013();
    When I run the test from VStest.console.exe, I see the following:
    vstest.console.exe /testcasefilter:"TestCategory=LongTest" /settings:"C:\testing\CodedUI.testsettings" /logger:TRX /logger:CodedUITestLogger C:\AppTests\CodedUITest.dll
    Microsoft (R) Test Execution Command Line Tool Version 12.0.31101.0
    Copyright (c) Microsoft Corporation. All rights reserved.
    Running tests in C:\testing\bin\debug\TestResults
    Starting test execution, please wait...
    I want to report on the status of the iterations DURING the test run from VStest.console.exe, like how the test explorer window does this. 
    How can I achieve the output below (notice the (Data Row ) values) ?
    vstest.console.exe
    /testcasefilter:"TestCategory=LongTest"
    /settings:"C:\testing\CodedUI.testsettings"
    /logger:TRX
    /logger:CodedUITestLogger
    C:\AppTests\CodedUITest.dll
    Microsoft (R) Test Execution Command Line Tool Version 12.0.31101.0
    Copyright (c) Microsoft Corporation. All rights reserved.
    Running tests in C:\testing\bin\debug\TestResults
    Starting test execution, please wait...
    Test Passed - Create_And_Build_All_Templates (Data Row 1)
    Test Passed - Create_And_Build_All_Templates (Data Row 2)
    Test Failed - Create_And_Build_All_Templates (Data Row 3)
    Test Passed - Create_And_Build_All_Templates (Data Row 4)
    Ian Ceicys

    Jack, again the results are printed to the std. out console AFTER the test data row has been completed. Is there a way to query VSTest.console and find out which test\data row is being executed so it can be written out to the console
    DURING the test run? 
    I put together the following screencast showing the issue: 
    http://www.screencast.com/t/IrxxfhGlzD
    Also here is the github repo with the source code that I included in the screen cast:
    https://github.com/ianceicys/VisualStudioSamples2015
    Take a look at LongRunningDataDrivenTest.sln
    Unit Test
    [TestClass]
    public class UnitTest
    public static int _executedTests = 0;
    public static int _passedTests = 0;
    public void IncrementTests()
    _executedTests++;
    public void IncrementPassedTests()
    _passedTests++;
    [TestInitialize]
    public void TestInitialize()
    IncrementTests();
    Console.WriteLine("Total tests Row executed: {0}", _executedTests);
    [TestCleanup]
    public void TestCleanup()
    if (TestContext.CurrentTestOutcome == UnitTestOutcome.Passed)
    IncrementPassedTests();
    Console.WriteLine("Total passed tests: {0}", _passedTests);
    private TestContext testContextInstance;
    /// <summary>
    /// Long Running Test
    /// </summary>
    [TestCategory("Long Running Test Example"),TestMethod]
    [DeploymentItem("data.csv")]
    [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV",
    "|DataDirectory|\\data.csv",
    "data#csv",
    DataAccessMethod.Sequential),
    DeploymentItem("data.csv")]
    public void LongRunning_TestMethod_Takes_Over_30_Seconds_to_Run()
    WaitTime(Convert.ToInt32(TestContext.DataRow["WaitTime"].ToString()));
    public void WaitTime (int waittime)
    Thread.Sleep(waittime);
    public TestContext TestContext
    get { return testContextInstance; }
    set { testContextInstance = value; }
    data.csv
    WaitTime,
    13000
    19000
    10000
    11000
    15000
    Ian Ceicys

  • Help with filtering a query with a date as string column

    Hello -- I've got a table column that contains dates as
    string/text type (access db). I need to make a query of my table
    that includes only the dates that match today's date (example
    5-13-2008). I need two parts. One is to capture today's date, and
    another to set the filter in the query.
    Here's my base query
    <cfquery name="someQuery" datasource="someDS">
    SELECT col1, col2, dateCol, col4
    FROM someTable
    WHERE dateCol = "today's date"
    </cfquery>
    What's the best way to capture today's date? And then what's
    the best way to set it to a string so I have an object to compare
    with dateCol. I know #now()# will get today's date, however it
    returns date + time. How can I format it as M-D-YYYY? Then, how do
    I convert it to a string so I can evaluate in my query? Any help is
    appreciated!

    quote:
    Originally posted by:
    Dan Bracuk
    Redesign your database and store dates as dates instead of
    strings.
    I would love to do this, however I couldn't figure out how to
    store date and time values AS DATE to my database. My front end is
    Flex with a Coldfusion backend. When a form is filled, I need it to
    send the current time and the current date of submission. Using
    Date(), I can obtain the current date (date + time). However it's
    not easy to separate the [date] and [time] values of the Date()
    result without using a dateformatter with a mask. By doing this,
    I've now taken my date as DATE and converted it to date and time
    both AS STRING. Well after several trial and error tries as well as
    looking for any help online, I just decided to use the
    dateformatter, convert date and time to string and then save each
    to their own columns.
    The other way of doing this is to just have one column that
    holds both the date and time, and use Date() to pass the correct
    data-type to my db. However, when passing Date() to my db, it only
    stores the date but sets the time to 00:00:00. Now if I could find
    a way to get both correct date and time (example 5-13-2008 1:31:xx
    PM), I could just use a dateformatter in my front end to display
    the dates as I want. Again, the problem is I need the TIME value as
    well, and it keeps defaulting to 00:00:00 in access.
    @paross1-- I will try what you've provided just to get this
    thing working, regardless if they are strings in the db instead of
    dates.
    If anyone can solve my default time issue mentioned above,
    that would be great too..

  • Input ready query with default data

    hi expert
    How do I make input ready query to have a default value when signing in using WAD?
    thanks.

    Hi,
    Use the following document for your query. If found useful do grant me number!
    Revaluating Planning Functions (with Analysis Web Item)
    Use
    You want to build a planning application with which you can enter turnover amounts for certain account numbers and revaluate them using a factor that can be set. If you select a row of the table, only the amount in this row is to be revaluated. If you do not select any rows, all values are to be revaluated. The planning application is to look roughly as follows on execution:
    This example serves in particular to clarify the interaction between a planning function and an Analysis Web item. Special properties here are:
    &#9679;      Variable handling in the planning function
    &#9679;      Row selection in the Analysis Web item
    Prerequisites
    In the planning modeler, you have created an aggregation level that contains the following InfoObjects: unit Currency Key, time characteristics Quarter and Calendar Year, key figure Amount, characteristics Version, Account Number, Cost Center.
    The planning function and the query are to use the same data of this aggregation level.
    Procedure
    Planning Modeler: Creating Planning Functions, Variables, and Filters
           1.      Choose the Planning Functions tab page and create a planning function of the type Revaluate with technical name REVALUATE and description Revaluate for your aggregation level.
           2.      On the To the Parameters tab page, use the input help for the revaluation factor to create the REVAL_FACTOR variable with the Revaluation Factor description. The variable is to be specified in detail as follows: The variable is to be a required variable and is to be input ready; it is to be of type Number, but is not to contain a standard default value.
           3.      Choose the Filter tab page and create a filter with technical name ACCOUNT_FILT and description Revaluation Selection for your aggregation level.
    Select the characteristics one after another and choose the input help icon in the column after Characteristic Restrictions. The dialog box for specifying characteristic restriction appears. Specify the required restrictions (in our example, Version = VERSION 1, Quarter = QUARTER 1, Calendar Year = 2007; Cost Center = 100002, Currency = Euro; for Account Number, all values are taken over), choose Add, and save the selections by clicking OK.
    Choose Show Extended Settings and ensure that the Version characteristic cannot be changed on execution. (It must be possible to change the Amount key figure).
    More information about creating planning functions, variables, and filters: Modeling Planning Scenarios
    BEx Query Designer: Creating Queries
           1.      In the BEx Query Designer, create a query Revaluate (technical name: QUERY_REVALUATION) for your aggregation level.
           2.      Drag and drop the ACCOUNT_FILT filter into the Characteristic Restrictions area for filter values. In doing so, all characteristics are restricted to single values.
    Drag and drop the Account Number characteristic into the area for default values.
           3.      Specify that the Account Number characteristic is in the rows. The values for this come from the master data.
    Specify that the Amount key figure is in the columns. The values for this can be changed; on the Planning tab page, choose the Data Can be Changed Using User Input or Planning Functions option.
           4.      Save your query definition.
    BEx Web Application Designer: Creating Web Templates
           1.      In the BEx Web Application Designer, create a Web template with technical name REVALUATION.
           2.      Create the following data providers:
    &#9675;       DP_PLAN_DATA of the type Query View Data Provider, based on query QUERY_REVALUATION
    &#9675;       DP_FILT_REVALUATION_FUNCTION of the type Filter. The data binding should come from the ACCOUNT_FILT filter.
           3.      Create the following Web items:
    &#9675;       INPUT_FIELD_REVALUATION_FACTOR. Specify 10 as the default value (Internal Display ® Text: 10).
    &#9675;       BUTTON_GROUP_ REVALUATION. Using Internal Display, create pushbutton1 with label Revaluation and, as Action, use the command wizard to assign the following commands (INSTRUCTION):
    Table of Commands
    Command
    Parameters
    Data provider-specific command: SET_SELECTION_STATE BY BINDING (Set Filter Values According to Different Sources)
    &#9679;      Command target: target data provider DP_FILT_REVALUATION_FUNCTION
    &#9679;      Data binding: selection binding using the Account Number (ZD_ACCNT) characteristic, where the value of the Web Item Selection binding type is to come from the ANALYSIS_ITEM_1 Web item, characteristic Account Number (ZD_ACCNT).
    Planning-specific command EXEC_PLANNING_FUNCTION_SIMPLE (Execute Planning Function )
    &#9679;      Data binding: Reference to data providers of type Filter DP_FILT_REVALUATE_FUNCTION, where the value from variable REVAL_FACTOR of connection type Web Item with Manual Input (ITEM_INPUT) is to come from INPUT_FIELD_REVALUATION_FACTOR.
    &#9679;      Command-specific parameter: planning function REVALUATE
    &#9675;       ANALYSIS_ITEM_1. Data provider DP_PLAN_DATA is assigned to the analysis grid as the (source) data provider.
    Choose Behavior ® Row Selection ® Multiple (MULTIPLE).
    In this case, it must be possible to select multiple rows and to execute the revaluation command on all selected rows. It is not therefore possible to give the command along with the row selection; the command must instead be given using pushbuttons.
           4.      Create a CONTAINER_LAYOUT_ITEM_1 (Web Items ® Enhanced ® Container).
    Divide the container into columns, choose the With Tray display option, and enter label Revaluation under Tray Settings.
    Add the following Web items to the container:
    &#9675;       1st row, 1st column: INPUT_FIELD_REVALUATION_FACTOR
    1st row, 2nd column BUTTON_GROUP_ REVALUATION
    &#9675;       2nd row, 1st column (with option Colspan=2, that is, with a merge of columns 1 and 2): ANALYSIS_ITEM_1
    The following figure illustrates the layout of the REVALUATION Web template:
    Execution on the Web
           1.      Execute the Web template on the Web.
           2.      For testing, extend the URL to include parameter &debug=X.
    If you have set this parameter, the selection is shown in the Executing Planning Function section.
           3.      Enter amounts for one or more account numbers, change the revaluation factor if necessary (default value = 10), select the required rows, and choose Revaluation.
    For example, enter amount 100 in the first row, retain revaluation factor 10, and choose Revaluation. The query outputs an amount of 110 in both the selected row as well as in the overall result (as long as you have not entered any other values).
    Regards,
    SUbha

  • SQL query with parameter returns empty result set, please help !!!

    Hi there,
    When I use the following query :
    <sql:query var="beroepsthemas" >
    select *
    from beroepsthemas
    where beroepsthemaid = ?
    <sql:param value="12"/>
    </sql:query>
    When I want to browse the result set with :
    <c:forEach items="${beroepsthemas.rows}" var="rij">
    it shows no records. But it must return at least one.
    All my jsp pages with sql queries and parameters have the same problem.
    This is all on my test environment. I'm using Ubuntu 5.10, Netbeans5.0, JDK 1.5_06, application runs in Bundeled Tomcat 5.5.9, MySQL 4.1.12, mysql-connector3.1.6
    When the same code is run on the live environment, it works just fine.
    The difference is :
    Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
    What can there be wrong !!

    When the same code is run on the live environment, it
    works just fine.
    The difference is :
    Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
    I didn't catch this. I think you may need to update the database driver.

  • Select query with blank date

    Hi All,
    I have issue with my select query, this query should execute when the date is empty in the table. Fields for the date is (trrecv and trpay)
    code:
    SELECT * FROM zcat3_mov
                       INTO CORRESPONDING FIELDS OF
                       TABLE lt_invmov
                       WHERE bukrs  EQ zcat3_mov-bukrs
                       AND trans EQ zcat3_mov-trans
                       AND status EQ 'CD'
                       AND clear  EQ ' '
                       AND trrecv EQ ' '
                       AND trpay  EQ ' '.
    Thanks,
    FED

    Hi,
    to check for blank date fields in database tables always use :
    date1 = '00000000'
    so your query will be -
    SELECT * FROM zcat3_mov INTO CORRESPONDING FIELDS OF TABLE lt_invmov
                            WHERE bukrs  EQ zcat3_mov-bukrs  AND
                                  trans  EQ zcat3_mov-trans  AND
                                  status EQ 'CD'             AND
                                  clear  EQ ' '              AND
                                  trrecv EQ '00000000'       AND
                                  trpay  EQ '00000000 '.
    regards,
    Shaurabh Pandey

  • Query with Start Date and End Date

    Dear Members,
    I have done a basic query on to get a report on Sales Invoices processed in a given period with the General Ledger account they were posted to. Minor hassle is that to change the dates, I have to go into the script (see extract below) and change dates manually, save query etc.
    Is there a way to have the query, when selected to run, pop up with window, allowing user to input say "start date" and "finish date". I imagine it will require some complex addition to the script below, any assistance will be appreciated.
    Regards
    Raj
    SELECT T1.[DocNum] AS 'Document Number', T1.[DocDate] AS 'Posting Date', T0.[AcctCode] AS 'Account Code', T0.[Dscription] AS 'Item/Service Description', T0.[LineTotal] AS 'Row Total' FROM  [dbo].[INV1] T0  INNER  JOIN [dbo].[OINV] T1  ON  T1.[DocEntry] = T0.[DocEntry]   WHERE T1.[DocDate] > (CONVERT(DATETIME, '20110801', 112) )  AND  T1.[DocDate] < (CONVERT(DATETIME, '20110831', 112) )

    Hi Raj,
    try this:
    /*SELECT FROM [dbo].[OINV] T0*/
    declare  @StartDate as datetime
    /* WHERE */
    set @StartDate = /* T0.DocDate */ '[%0]'
    /*SELECT FROM [dbo].[OINV] T1*/
    declare  @EndDate as datetime
    /* WHERE */
    set @EndDate = /* T0.DocDate */ '[%1]'
    SELECT T1.DocNum AS 'Document Number', T1.DocDate AS 'Posting Date', T0.AcctCode AS 'Account Code', T0.Dscription AS 'Item/Service Description', T0.LineTotal AS 'Row Total'
    FROM dbo.INV1 T0 INNER JOIN dbo.OINV T1 ON T1.DocEntry = T0.DocEntry WHERE T1.DocDate > @StartDate AND T1.DocDate < @EndDate
    Thanks,
    Neetu

  • Results on query with filter, but zero results when filter removed

    I have been handed the below query and I may be missing something blindingly obvious here but if i run it i get no results
    SELECT lipqoh
    FROM f41021 a , f0006 b
              WHERE      b.mcmcu = a.limcu AND
                   b.mcstyl = 'W';
    if i add the filter a.liitm = 105900 like below data is returned (although the entries are 0 as expected at the moment, this is not always the case)
    SELECT lipqoh
    FROM f41021 a , f0006 b
              WHERE      b.mcmcu = a.limcu AND
                   b.mcstyl = 'W'
    a.liitm = 105900;
    the fields for each of the tables mentioned in the query have the following characteristics
    lipqoh Number NULLABLE
    mcmcu Char(12 BYTE) NOT NULLABLE
    mcstyl Char(2 BYTE) NULLABLE
    liitm Number NOT NULLABLE
    Any guidance would be greatly appreciated

    here is a small sample of the output from the query you provided, the explain plan for the query without additional filter does not mention an index just Partition List Table Access F41021 Full
    LIPQOH MC
    DUMP(B.MCSTYL)
    DUMP('W')
    MCMCU
    DUMP(B.MCMCU)
    DUMP(A.LIMCU)
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    CSW
    Typ=96 Len=12: 32,32,32,32,32,32,32,32,32,67,83,87
    Typ=96 Len=12: 32,32,32,32,32,32,32,32,32,67,83,87
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    CSW
    Typ=96 Len=12: 32,32,32,32,32,32,32,32,32,67,83,87
    Typ=96 Len=12: 32,32,32,32,32,32,32,32,32,67,83,87
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL01
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,49
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,49
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL01
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,49
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,49
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL02
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,50
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,50
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL05
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,53
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,53
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL06
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,54
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,54
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL08
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,56
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,56
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL08
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,56
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,48,56
    0 W
    Typ=96 Len=2: 87,32
    Typ=96 Len=1: 87
    SOL22
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,50,50
    Typ=96 Len=12: 32,32,32,32,32,32,32,83,79,76,50,50

Maybe you are looking for

  • Software tools to test bridge performances

    I'd like to know if these is any sotware tool to check performance in a building to building connection (with aironet 350 bridge). Now I'm timing the transfer of big files from a bridge to the other, but I want to find a more powerful tool (if possib

  • Workflow in PR Release

    Hi All, is it Possible to have both standard workflows ( item wise Release, Overall release ) For Puchase Requistion? Since already we are working with Overall release PR and Again we need item wise Release For Certain Items .Please Suggest Me ......

  • Transparent Background - shape layer?

    CS4 So I have this great little shape and I want to save it as a jpeg with a transparent background so that IE will show a gradient around it. However, IE is showing only a white background around the shape. My the thumbnail in the shape layer is als

  • Can't prevent letter getting propagated as a series?

    When I highlight a number and drag down, it fills with the same. This doesn't happen for letters - it fills with the next in series and not with the same letter. Anyone figured how to prevent this?

  • How do I access documents stored in Preview folder on my iOS device

    I have Yosemite Beta 3 on my Mac and just updated my 3rd gen. iPad to iOS 8. With iCloud Drive I assumed I could save PDF files in iCloud, either in Preview or directly in iCloud Drive and then be able to see them on my iPad or iPhone.  So far I have