Query for todays Posting Date

Currently my query is as follows, I want to create report that pulls produciton orders that are either planned or released where the post date is today...as my understanding getdate() does not work...may I get some assistance?
SELECT T0.[DocNum], T0.[PostDate], T0.[DueDate], T0.[ItemCode], T0.[PlannedQty]
FROM OWOR T0
WHERE T0.[PostDate] = GetDate() AND
T0.[Status] = 'p' OR
T0.[Status] = 'r'
Thank you
Sarith

Hi Sarith,
Try:
SELECT T0.DocNum, T0.PostDate, T0.DueDate, T0.ItemCode, T0.PlannedQty
FROM OWOR T0
WHERE DateDiff(dd,T0.PostDate,GetDate()) = 0 AND T0.Status in ('p','r')
Thanks,
Gordon

Similar Messages

  • Date query doesn't show results for today's date

    Hello everyone. I use Jdeveloper 11.1.1.3.0 with ADF and I have a view named query with just one field, Date. The operator it is using is equal to a value written in the field. The problem is that when I insert a row into the table (the date is automatically set to the current date on insertion) and I look for today's date it returns nothing. However if I leave the field empty it will find me the row. I tried doing this with the timestamp option but it's not very user friendly as the user would have to type in the time the row was inserted in order to find it, or use the between operator for two fields which is something I want to avoid if at all possible
    The requirement is one field query that lets the user choose a date from a calendar and shows all rows inserted on that date (even if the date is today and the row was inserted a few minutes before).
    Edited by: Dino2dy on Apr 6, 2011 2:50 AM

    Dino2dy,
    My guess is that the data being stored in the DB has a time component associated with it (as it would if you were using something like SYSDATE to populate it). When you are trying to look for data with today's date, you are checking just for the date - which in Oracle is the equivalent of midnight on the start of the date. The dates don't match because the time is different.
    Either store the date with no time component (use TRUNC to remove the time), use a BETWEEN comparison, or TRUNC the date when comparing.
    John

  • Select statement for today's date

    Hi,
    I need to write  a select query which fetches all  the entries of a table for today's date , how do i do it pls..

    Hi,
    SELECT <field-names to retrieve>
       FROM <database table name>
        INTO  TABLE <internal table name>
    WHERE <date field name> eq sy-datum.
    or
    SELECT * FROM <database table name>
        INTO  TABLE <internal table name>
    WHERE <date field name> eq sy-datum.
    this statement will fetch all the data's from your database table with respect to your date field. use parameter or select option to get the field value...then finally use
    loop at <itab>
    write: / <itab-field>.
    endloop.

  • How to add custom line for today's date

    Hi,
    I want to add one vertical line for today's date on my line chart.
    Is it possible to draw custom line dynamically in line chart.
    Thanks in advance
    Madhuri

    I think you will probably need CRChart by ThreeD Graphics (www.threedgraphics.com).  AFAIK, it's written by the guys who supply the charting module to Crystal, so integrates 100%, even if it's a bit fiddly.
    It's a bit pricey (more than CR!), but if you need that functionality, it's about your only option. I've bought it do add a 'your average' linesymbol and 'everyone's average' linesymbol to a chart.
    Essentially, it uses macros to plot user defined lines, box fills, shapes etc onto your chart.
    You put something like this into the text fields of the chart:
    @user_line 0,0,3,100 = draw a line from the 0,0 point to the 3rd group, 50th y-value.
    You can use variable to define these points, so if you have a chart in a group, it'll display a different line position for each group.

  • Need a query for export table data .....

    Hi,
    I need a query for exporting the data in a table to a file.
    Can anyone help me ?
    Thanking You
    Jeneesh

    SQL> spool dept.txt
    SQL> select * from dept;
        DEPTNO DNAME          LOC
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    SQL> spool off
    SQL> ed dept.txt

  • USER EXIT FOR CHANGING POSTING DATE IN THE MATERIAL DOCUMENT

    Hi,
    Pls advise any USER EXIT FOR CHANGING POSTING DATE IN THE MATERIAL DOCUMENT.
    Regards,

    Hi,
    There is another user exit for updating material document data Upon posting  is MB_CF001
    I hope this will fullfill you.
    Prem

  • Bapi/function module to get opening or closing stock for a posting date

    I am creating a report where i need to get the opening stock value and closing stock value  for the given starting date and ending date respectively for the PP report.
    The T-code for that is MB5B.
    So,can any1 plzz tell me how i can get the stock value for a starting date/ending date...
    Is there any BAPI or function module to find this out..
    or any logic?
    Thanks.

    Hi Kiran,
    You would like to findout opening and closing stock of a particular period and of a particular period....
    If we would like to findout opening and closing stock of material A as of 18 / 8 / 2008,
    then do like this.
    go to MBEW table .. there u get opening stock as on today. Today the date is 20/8/2008. from today's opening stock if we add / subtract the movements which have happened on 19/8/2008 and 18/8/2008 u'll get opening and closing stock as on 18/8/2008.
    U get the movements from MKPF ( material doc header) and MSEG (material doc item ) based on posting date. In MSEG u get movement type.
    If the movement type is 101, it means the stock is added.
    If the movement type is 102, it means the added stock is reversed.
    from today's opening stock deduct the stock with moverment type 101 and add the stock with movement type 102.
    This will give u opening stock as on 18/8/2008.
    To get closing stock of 18/8/2008 ..... the opening stock of 19/8/2008 is 18/8/2008's closing stock.

  • SQL Query for SSRS has data but fields don't show that data

    I am having a strange issue here with my new report;
    First off, this report is an availability report for employees. If they are busy then a 0 should be displayed for that Hour and if they are free then a 1 is to be displayed. There are 2 parameters setup for use in this query, one is a Date/Time parameter
    and the other is a Text parameter where another Dataset Query is grabbing the data for (Departments)
    I have 2 Parameters, 1 is for a Department and the other is to select the date.
                           Hour1     Hour2    Hour3     Hour4    Hour5   
    Hour6    Hour7
    Smith, John     |     1     |     0     |     0     |     0     |   
    1     |     1     |     1     |
    Som, One        |     1     |     1     |     1     |     0
        |    0     |     1     |     1     |
    When I run the query in the Query Designer for the Dataset the information is displayed correctly and as I would expect it, however, when I run the Report and choose the same information for the 2 parameters then the report only ever shows all 1's;
    Smith, John     |     1     |     1     |     1     |     1     |   
    1     |     1     |     1     |
    Som, One        |     1     |     1     |     1     |     1    
    |    1     |     1     |     1     |
    I've tried searching but didn't know what term to use that describes what is going on.
    Like I said, this works if ran in SSMS and works when ran in the Query Builder of SSRS but when it comes to displaying the data on the report the incorrect information is displayed.
    Any help would be appreciated.
    EDIT
    I have also ran the Report Table Wizard with the same query and chosen Names as the row and Hours as the columns and the same thing happens - just all 1's are displayed even thought the query in Query Builder shows correct information.

    The difference running the query directly in query designer and when the report runs is that you manually type in values for the parameters when running query designer. It is likely that the parameter values from the report have a different syntax than you
    expect. This will happen especially when setting the available values of a parameter from a data cube query. A value from an analysis cube may be displayed in the query designer as "\Project\Iteration Node" while the actual value is "[Work Item].[Iteration
    Hierarchy].[Iteration2].&[-7189901615194941888]&[-8272609059741292246]". Very different as you can see. This example is from the TFS analysis server.
    The best way to validate that your parameters are passing the values (and syntax) you expect is to add text boxes to your report for each parameter and set them to display Parameters!ParameterName.Value.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Query for selecting current date when running report

    Hi all
    I need a query that will copy today's date on posted sales order via DTW then that query will be linked to an alert and be sent to the sales manager every morning after the import went through successfully.
    The report at the moment is running fine as i pulling through the other info required the only problem is it's pulling all the sales orrders on the system , we want it to pull only the days orders imported.

    You could use either of these queries
    SELECT T0.DocNum, T0.DocDueDate, T0.CardCode, T0.CardName, T0.DocTotal, T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK
    FROM [dbo\].[ORDR\] T0
    WHERE T0.DocDate = GETDATE()
    ORDER BY T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK, T0.DocDueDate
    OR
    SELECT T0.DocNum, T0.DocDueDate, T0.CardCode, T0.CardName, T0.DocTotal, T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK
    FROM [dbo\].[ORDR\] T0
    WHERE DATEDIFF(Day, T0.DocDate, GETDATE()) = 0
    ORDER BY T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK, T0.DocDueDate

  • No records for 2LIS_04_P_COMP, posting date & entry date not in same month

    Hi All,
    I m unable to get records in rsa3 for my DS 2LIS_04_P_COMP if my entry date and posting date of production order is not same or not in same month.
    Please suggest.
    Niraj

    Hi,
    It depends up on your Delta relevant field either it is Changed on or Time Stamp. What is ur delta field?
    Regards,
    Suman

  • UPDATE query for GEOMETRY (spatial data)

    Hi,
    how to update values dynamically for this geometry type " MDSYS.SDO_GEOMETRY(2002,8307,MDSYS.SDO_POINT_TYPE(0,0,'null'),MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(-0.44106912,0.46456902,-0.72306504,0.09942102))" please help me.

    Thanks Reetesh for your reply.
    As this is a simple task I wan't to do it via OAF query rather than writing PL/SQL procedure.
    I have two tables , say error table and interface table, (there is a foreign key relation ship between these tables, ie. i have to show the interface name present in the interface table via the foreign key in the error table). I used the following query to get the data
    SELECT xxgblErrorMasterEO1.ERROR_ID_NO,
    xxgblErrorMasterEO1.ERROR_CODE,
    xxgblErrorMasterEO1.ERROR_MESSAGE,
    xxgblErrorMasterEO1.CREATED_BY,
    xxgblErrorMasterEO1.CREATION_DATE,
    xxgblErrorMasterEO1.LAST_UPDATED_BY,
    xxgblErrorMasterEO1.LAST_UPDATE_DATE,
    xxgblIntfProgramMaster.INTERFACE_NAME,
    xxgblErrorMasterEO1.ERROR_TYPE
    FROM XXEEG.XXGBL_ERROR_MASTER xxgblErrorMasterEO1,
    XXEEG.XXGBL_INTF_PROGRAM_MASTER xxgblIntfProgramMaster
    where xxgblErrorMasterEO1.INTERFACE_ID_NO =
    xxgblIntfProgramMaster.INTERFACE_ID_NO
    I like the idea of Advanced table while going through the tutorial (example 2) and would want to show certain fields by expanding on the + mark ( just like in the explorer)
    now i want to update any of the fields that i show to the user (except the WHO fields). Say for example if the user updates the error_message and Interface_name, so how should i write the update method in the AM ?
    Pardon me if this sounds simple :(

  • ABAP Query on Recent Posting Date in G/L Account

    Dear All
    This is the new request that has come from the client. What they want to see is the G/L account and the most recent Posting Date. For eg Lets say that 220000 has 3 line items
    1000 in march 06
    2000 in april 06
    3000 in may 06
    End user wants to see Balance as 6000 and the most recent Posting date as may 06. If i Pull Accounting Doc # and Posting Date it will give me all the details and date which i dont really want. How do i do it ?
    Please help me
    Thanks
    Sameer

    Hi,
    try table GLT0 (for Rel. 4.6C)
    A.

  • Query need (Today's date - schedule date) --- Important

    Hi
    I have BEx report. One of the fields in this query is a date field i.e. schedule date (characteristic). I want to add up one more field in my query which will show me (today's date - schedule date). I dont know how to implement it.
    Pls let me know
    Thanks...

    What about "Query date" to be used as today's date. Or do it in user exit variable in ABAP via sy-datum variable.
    Check out following:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a?quicklink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d?quicklink=index&overridelayout=true

  • Query for select CLOB data field

    Hi All,
    I want to know how to write a SQL query for select CLOB tyoe data from a tablw. when I am trying to use the simple SQL it gives an messageLOB types requires OCI8 mode and currently uasing OCI7 ode.
    Also I am not aware of oci mode?
    If its working for OCI8 mode how I should changer it in to OCI8 mode? (I am using 10g rel 2)
    Thans and regards
    Buddhike

    Hi ,
    i don't want to use loop (sy-tabix) ..
    any particular reason for this ?
    as u cannot automatically generate serial number, u have to go for loop....endloop.
    Thanks
    Karthik

  • Query for item master data

    hi all,
    i want to create a query for items in the item master data that shows the changed field, the old value, the new value, user name and the date it was changed .
    can anyone help please.
    ciao

    thanks for the reply
    my clients internal auditors require that they have Exception Reports in SAP , i.e reports that can show changes made, date and by which user etc...
    1. changes made to item master data
    2. changes made to business partner master data
    3. changes made to invoices, purchase orders etc..
    this reports can be set in query form or xl reporter..
    i tried but couldent find the tables ....
    any sugestion will be appriciated..

Maybe you are looking for

  • Warping cursor to other screen in Awesome, when reaching screen edge

    I'm using xfce with awesome as window manager. One of the most annoying "feature" in xfce is that desktop icons are always in the left screen. Because I'm using Awesome, I can't move icons manually to the right screen and because of xfdesktop's natur

  • IDOC Ack from BPM to SAP R3 runs into an error

    Hi All, I have a scenario which sends an DEBMAS IDOC to an Integration Process "IP_SPLIT_Site" which process the IDOC and sends it to multiple systems. When the IDOC is sent from SAP R3 to the receiving Integration Process "IP_SPLIT_Site" in XI, it i

  • Alv Mark Problem

    Hi ı have problem with alv is_layout when ı set  gs_layo-box_fieldname  = 'MARK' its ok synt. correct and program run healthy but in alv ı want to batch input selected row it goes to dumb. When ı removed 'mark' it is working here is the code FORM alv

  • Need Help - Contract Management & Marketplace

    Hi, We have got some requirement of developing 'Contract Management' and 'Marketplace' applications. In contract management the complete business process starting from demand planning, hiring, mobilization / execution / demobilization of contract and

  • ABAP performance issues and improvements

    Hi All, Pl. give me the ABAP performance issue and improvement points. Regards, Hema