Query for "installed on date"

Hi,
I am having trouble running a query to get the "installed on Date". I am not very good at this.  I've been using the script below, but I can't get the correct language for the installed on date. I'm hoping someone can help me complete it and
tell me what I need to enter below the ???. Any help would be greatly appreciated! Thanks.
select SMS_R_System.NetbiosName,
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from
SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId =
SMS_R_System.ResourceId where
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%????%"

When you answer Sherry's question, you'll probably realize that you could perhaps use SSRS (reporting) instead of WQL query (if you just want a list instead of a collection). As Sherry mentions, it depends on what you plan on doing with the data.
As for your question about the "installed on date", what exactly are you asking? Do you want to know the name of the Installed Date field?
Replace ??? with an actual string form a software name...
SQL
SELECT
SYS.Name0
,ARP.DisplayName0
,ARP.InstallDate0
FROM
v_R_System As SYS
inner join v_GS_ADD_REMOVE_PROGRAMS As ARP on ARP.ResourceId = SYS.ResourceId
WHERE
ARP.DisplayName0 like '%???%'
WQL
SELECT
SYS.NetbiosName
,ARP.DisplayName
,ARP.InstallDate
FROM
SMS_R_System As SYS
inner join SMS_G_System_ADD_REMOVE_PROGRAMS As ARP on ARP.ResourceId = SYS.ResourceId
WHERE
ARP.DisplayName like "%???%"
This got me the results,, but does not show the installed on date. I Am I missing something to enter?

Similar Messages

  • 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

  • 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.

  • 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 :(

  • 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..

  • Query for getting Workcenter data

    Dear Professionals,
    I got an issue where user needs the data from the work center. So i made a query joining the table CRHD, CRCO, CRCA & CRTX here for all the Tables OBJID & OBJTY is available, but the query results in "no data found". Am i doing some mistake else is there any other way i could get the data.
    Thanks in advance
    Regards
    Prashant.Pillai

    Hi there,
    try the following:
    1. link CRHD- CRCO with left outer join - do You have the data in both table? if yes
    2. change CRHD-CRCO to inner join and add CRCA with left outer join - do You have the data?
    (No need the text tabe You can find it in add fields in query)
    Br

  • Insert query for insert all data into table in vb6 but it insert 1 row in table

    This is My insert query in vb6 but it insert 1 row in table
    But i want insert all data in the table which contain the id =1.
    Note that billtabsuport is blank
    i want solution for this
    strSQL = " select * from billtabsuport1 where StockID=" & lblid.Caption
    Set DBrecordset = DBConnection.Execute(strSQL)
    strSQL = " Insert into billtabsuport values('" & DBrecordset("StockID") & "','" & DBrecordset("C_Name") & "','" & DBrecordset("C_Add") & "','" & DBrecordset("C_Mobile") & "','" & DBrecordset("Invoice_No") & "','" & DBrecordset("Date") & "','" & DBrecordset("Order_No") & "','" & DBrecordset("T_Name") & "','" & DBrecordset("Dest") & "','" & DBrecordset("D_Date") & "','" & DBrecordset("Tyres_Serial_No") & "','" & DBrecordset("P_Desc") & "','" & DBrecordset("PR") & "','" & DBrecordset("Branded_NonBranded") & "','" & DBrecordset("Claim_No") & "','" & DBrecordset("Qty") & "','" & DBrecordset("U_Price") & "','" & DBrecordset("I_Value") & "','" & DBrecordset("V_Rate") & "','" & DBrecordset("V_Amt") & "','" & DBrecordset("Size") & "','" & DBrecordset("Pattern") & "','" & DBrecordset("TypesOfStock") & "','" & DBrecordset("TypesOfTube_Flap") & "','" & DBrecordset("VatAmount") & "')"
    DBConnection.Execute (strSQL)

    The syntax for inserting from one set of tables to a new table is:
    insert into newtable
    (field1, field2, etc)
    select somefield1, somefield2, etc
    from some other tables
    where whatever

  • Query for Getting previous date in oracle in specifc scenario

    I have the below data in a table A which i need to insert into table B along with one compute column.
    TABLE A:
    Account_No | Balance | As_on_date
    1001 |-100 | 1-Jan-2013
    1001 |-150 | 2-Jan-2013
    1001 | 200 | 3-Jan-2013
    1001 |-250 | 4-Jan-2013
    1001 |-300 | 5-Jan-2013
    1001 |-310 | 6-Jan-2013
    Table B:
    In table B,there should be no of days to be shown when balance is negative and the date one which it has gone into negative.
    So,for 6-Jan-2013,this table should show below data:
    Account_No | Balance | As_on_date | Days_passed | Start_date
    1001 | -310 | 6-Jan-2013 | 3 | 4-Jan-2013
    Here,no of days should be the days when the balance has gone negative in recent time and not from the old entry.
    I need to write a sql query to get the no of days passed and the start date from when the balance has gone negative.
    I tried to formulate a query using Lag analytical function,but i am not getting how should i check the first instance of negative balance by traversing back using LAG function. Even the first_value function was given a try but not getting how to partition in it based on negative value.
    Any help or direction on this will be really helpful.
    Thanks

    I think you can apply the Tabibitoshan method here. The query is more complex but performs better than other methods. For an explanation, see Tabibitosan method tutorial by Aketi Jyuuzou
    The idea behind the method is to identify "continuous" records without gaps. Here I identify records that are "continuous" because they contain an uninterrupted series of negative balances.
    drop table t;
    CREATE TABLE t (Account_No , Balance , As_on_date) AS SELECT
    1001 ,-100 , to_date('1-Jan-13', 'DD-MON-YY') FROM dual UNION ALL SELECT
    1001 ,-150 , to_date('2-Jan-13', 'DD-MON-YY') FROM dual UNION ALL SELECT
    1001 , 200 , to_date('3-Jan-13', 'DD-MON-YY') FROM dual UNION ALL SELECT
    1001 ,-250 , to_date('4-Jan-13', 'DD-MON-YY') FROM dual UNION ALL SELECT
    1001 ,-300 , to_date('5-Jan-13', 'DD-MON-YY') FROM dual UNION ALL SELECT
    1001 ,-310 , to_date('6-Jan-13', 'DD-MON-YY') FROM dual;
    SELECT Account_No, Balance, to_char(As_on_date, 'DD-MON-YYYY') as_on_date,
    CASE
      WHEN balance < 0
      THEN row_number() OVER(PARTITION BY account_no, grp ORDER BY as_on_date)
    END days_passed,
    CASE
      WHEN balance < 0
      THEN to_char(
        first_value(as_on_date) OVER(PARTITION BY account_no, grp ORDER BY as_on_date),
        'DD-MON-YYYY'
    end start_date
    from (
      SELECT Account_No, Balance, As_on_date,
      CASE WHEN balance >= 0 THEN NULL ELSE
        row_number() OVER(PARTITION BY account_no ORDER BY as_on_date) -
        sum(CASE WHEN balance < 0 THEN 1 ELSE 0 END) OVER(PARTITION BY account_no ORDER BY as_on_date)
      end grp
      FROM t
    order by account_no, As_on_date;
    ACCOUNT_NO
    BALANCE
    AS_ON_DATE
    DAYS_PASSED
    START_DATE
    1001
    -100
    01-JAN-2013
    1
    01-JAN-2013
    1001
    -150
    02-JAN-2013
    2
    01-JAN-2013
    1001
    200
    03-JAN-2013
    1001
    -250
    04-JAN-2013
    1
    04-JAN-2013
    1001
    -300
    05-JAN-2013
    2
    04-JAN-2013
    1001
    -310
    06-JAN-2013
    3
    04-JAN-2013

  • How to Create Filter by date Query for access using Data base connectivity tool

    Hello,
    I had started my project by reading Access datas, by using an UDL connection,
    but now i want to create an access filter using a query that would permit to select two dates, and to obtain all corresponding datas, how to do it using the Parmetrized SQL query?
    Best regards,
    Remark: i dont know the SQL language
    ~~~~~~~~~~~~~~~~~~Looking for a LABVIEW JOB (In EUROPE)>~~~~~~~~~~~~~~~~~~
    **The Best Way To Predict**The**Future Is To Invent It**
    Solved!
    Go to Solution.

    Hi mike,
    I want to thank you for your help, i really appreciate it,
    i tried to make the code as ur picture, i had no problem to execute it, but i have no data's in the output
    i changed the date format, because i suppose that its a short date format in the database.
    can you just look at it, and tell me if you can find the problem,
    thank you again for your help
    Best regards,
    ~~~~~~~~~~~~~~~~~~Looking for a LABVIEW JOB (In EUROPE)>~~~~~~~~~~~~~~~~~~
    **The Best Way To Predict**The**Future Is To Invent It**
    Attachments:
    db.JPG ‏126 KB
    lav.JPG ‏82 KB

  • WQL Query for OS Build date

    Any WQL Query to retrieve data based on Operating System Build date.

    Hi,
    Please try the following query.
    select * from SMS_R_System
    inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId
    where SMS_G_System_OPERATING_SYSTEM.InstallDate < "4/3/2014 7:51:49 PM"
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Query for fetching unavailable data

    mst_company1
    company_year company_rating
    2001 A
    2004 AA
    2009 B
    2010 C
    2011 B+
    2020
    For the above table, mst_company1
    there are years from 2001 to 2020 and the rating for the years are as given above.
    There are few years which do not have any rating
    Now in the output I require the following:
    output:-
    Year Rating
    2001 A
    2002 NR
    2004 AA
    2005 NR
    2009 B
    2010 C
    2011 B+
    2012 NR
    In the output, the years which have a rating should be displayed as well as the next
    consecutive year should also be displayed having rating as NR (No Rating).
    For eg, 2001 has rating as A, so the next data to be displayed should be 2002 and rating should be
    NR, 2003 should not be displayed and then 2004 which has a rating as AA should be displayed
    and then 2005 with rating NR should be displayed, 2006 should not be displayed.
    What query should I write to achieve this ?

    So I need to replace the below query:-
    WITH     all_years     AS
         SELECT     first_year + LEVEL - 1     AS year
         FROM     (
              SELECT MIN (year)     AS first_year
              ,     MAX (year) AS last_year
              FROM mst_company1
         CONNECT BY     LEVEL     <= last_year + 1 - first_year
    SELECT     a.year
    ,     c.company_rating
    FROM          all_years     a
    LEFT OUTER JOIN     mst_company1     c ON a.year = c.company_year
    ORDER BY a.year
    with :-
    WITH     all_years     AS
         SELECT     first_year + LEVEL - 1     AS year
         FROM     (
              SELECT MIN (year)     AS first_year
              ,     MAX (year) AS last_year
              FROM mst_company1
         CONNECT BY LEVEL <= x
    SELECT     a.year
    ,     c.company_rating
    FROM          all_years     a
    LEFT OUTER JOIN     mst_company1     c ON a.year = c.company_year
    ORDER BY a.year
    ;

  • SCCM 2007 SQL Query for Advertisement Creation Date

    I have been asked if I can create a Query to list all advertisements that have been created in a 60 day period and the User that created them.
    I have tried a couple of SQL codes but I cant quite get the syntax to work.
    Here is what I have so far, but I still don't know if any of it is usable:
    v_Advertisement.AdvertisementName AS ‘Advertisement Name’,
    v_Advertisement.AdvertisementID AS ‘Advertisement ID’
    FROM v_Advertisement
    INNER JOIN v_Package ON v_Advertisement.PackageID = v_Package.PackageID
    INNER JOIN v_Collection ON v_Advertisement.CollectionID = v_Collection.CollectionID
    INNER JOIN v_ClientAdvertisementStatus ON v_Advertisement.AdvertisementID = v_ClientAdvertisementStatus.AdvertisementID
    AND v_Advertisement.AdvertisementID in(SELECT advertisementid FROM V_advertisement WHERE DATEDIFF(D, V_advertisement.presenttime,GETDATE())<=365)
    ORDER BY v_Advertisement.AdvertisementName
    Any help with this would be greatly appreciated.
    Regards
    AntonSK

    I saw you're missing select statement.
    Also, you need to know which table & column for these:
    - Advertisement Creation date?
    - User that created the Advertisement
    a sample of working query as below, but it's still missing the 2 items above
    select
    Adv.AdvertisementName as 'Advertisement Name',
    Adv.AdvertisementID as 'Advertisement ID'
    from
    v_Advertisement as Adv
    inner join v_Package as Pkg on Adv.PackageID = Pkg.PackageID
    inner join v_Collection as Col on Adv.CollectionID = Col.CollectionID
    inner join v_ClientAdvertisementStatus as AdsStatus on Adv.AdvertisementID = AdsStatus.AdvertisementID
    and Adv.AdvertisementID in(select Adv.AdvertisementID from v_Advertisement where datediff(d, Adv.PresentTime, getdate())<=365)
    order by 'Advertisement Name'
    ---Pat

  • Query for Finding the Date History

    Hi Geeks,
    My Table looks like this
    Employee Assignment Position     Job     Grade     Start_date     End_date
    101 132 2055 Clerk C01 10-Mar-00 11-Feb-01
    101 132 2055 Clerk C02 12-Feb-01 15-Dec-01
    101 132 2056 Clerk C02 16-Dec-01 22-Jul-03
    101 132 2055 Clerk C03 23-Jul-03 31-Dec-4000 --(unassigned)
    Now I need output like
    Employee Assignment Position Start_date End_date
    101 132 2055 10-Mar-2000 15-Dec-2001
    101 132 2056 16-Dec-2001 22-Jul-2003
    101 132 2055 23-Jul-2003 31-Dec-4000 --(unassigned)
    The following important things are to be considered
    1. Rows to be grouped by position
    2. Each row much have the start date and end date of the employee position. If the employee is the same postion and different grade or job that doesnt matter. But if the employee jumps from his position (2055) to 2056 and after sometime he comes to the same position (i.e. 2055) the date history should be separate.
    I am unable to derive the logic also. I think we need to create a function for this.
    Kindly help me out.
    Thanks in Advance
    Punithavel
    Message was edited by:
    Punithavel
    Message was edited by:
    Punithavel

    Too difficult to read. I have no database access to test (usually I use a step by step approach, proceeding with the next step when the current one is OK).
    I can describe a general idea (may post something afterwards with no promise it will work)
    step 1: mark the position changes
    step 2: retain only mark 1 and mark max(mark) of each group
    step 3: make a single row from the two rows of each group
    Regards
    Etbin
    with
    marking as
    (select employee,assignment,position,start_date,end_date,
            row_number() over (partition by employee,assignment,position order by start_date) the_mark
       from the_table
    collecting as
    (select employee,assignment,position,start_date,end_date,the_mark
       from marking m
      where the_mark = 1
         or the_mark = (select max(the_mark)
                          from marking
                         where employee = m.employee
                           and assignment = m.assignment
                           and position = m.position
                         group by employee,assignment,position
                         having count(*) > 1
    combining as
    (select employee,assignment,position,
            case when the_mark = 1 then start_date end start_date,
            case when the_mark = 1
                 then case when lead(position,1) over (partition by employee,assignment,position order by start_date) = position
                           then lead(end_date,1) over (partition by employee,assignment,position order by start_date)
                           else end_date
                      end
            end end_date
       from collecting
    select employee,assignment,position,start_date,end_date
      from combining
    where start_date is not null
    order by employee,assignment,position,start_date*** not tested ***
    Message was edited by: Etbin
    user596003
    on a lazy afternoon I took a look at your friend's solution too and I like it.
    It's more concise than mine (defining starts and ends).
    Not being able to test it the only problem in his solution might be the absence of order by clauses to assign correct rownums
    WITH lag_and_lead AS
    (SELECT employee,assignment,position,start_date,end_date,
            LAG (position) OVER (PARTITION BY employee,assignment ORDER BY start_date) AS lag_position,
            LEAD (position) OVER (PARTITION BY employee,assignment ORDER BY start_date) AS lead_position
       FROM your_table
      ORDER BY employee,assignment,start_date
    starts AS
    (SELECT employee,assignment,position,start_date,ROWNUM rn
       FROM lag_and_lead
      WHERE position <> lag_position
         OR lag_position IS NULL
      order by employee,assignment,start_date
    ends AS
    (SELECT employee,assignment,position,end_date,ROWNUM rn
       FROM lag_and_lead
      WHERE position <> lead_position
         OR lead_position IS NULL
      order by employee,assignment,start_date
    SELECT starts.employee,starts.assignment,starts.position,starts.start_date,ends.end_date
      FROM starts,ends
    WHERE starts.employee = ends.employee
       AND starts.assignment = ends.assignment
       AND starts.position = ends.position
       AND starts.rn = ends.rn
    EMPLOYEE ASSIGNMENT POSITION JOB   GRADE START_DATE  END_DATE
         101        132     2055 Clerk C01   10-Mar-2000 11-Feb-2001
         101        132     2055 Clerk C02   12-Feb-2001 15-Dec-2001
         101        132     2056 Clerk C02   16-Dec-2001 22-Jul-2003
         101        132     2055 Clerk C03   23-Jul-2003 31-Dec-4000
    lag_and_lead
    EMPLOYEE ASSIGNMENT POSITION START_DATE  END_DATE    lag_position lead_position
         101        132     2055 10-Mar-2000 11-Feb-2001         null          2055
         101        132     2055 12-Feb-2001 15-Dec-2001         2055          2056
         101        132     2056 16-Dec-2001 22-Jul-2003         2055          2055
         101        132     2055 23-Jul-2003 31-Dec-4000         2056          null
    starts
    EMPLOYEE ASSIGNMENT POSITION START_DATE  rn
         101        132     2055 10-Mar-2000  1
         101        132     2056 16-Dec-2001  2
         101        132     2055 23-Jul-2003  3
    ends
    EMPLOYEE ASSIGNMENT POSITION END_DATE    rn
         101        132     2055 15-Dec-2001  1
         101        132     2056 22-Jul-2003  2
         101        132     2055 31-Dec-4000  3
    EMPLOYEE ASSIGNMENT POSITION START_DATE  END_DATE
         101        132     2055 10-Mar-2000 15-Dec-2001
         101        132     2056 16-Dec-2001 22-Jul-2003
         101        132     2055 23-Jul-2003 31-Dec-4000Regards
    Etbin
    Message was edited by: Etbin
    user596003

  • 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

Maybe you are looking for