Return by date

Hi,
I wanted to creat a report that return the number of messages by a certain time, order by departement: i have in a table a creat_date, id_message and a id_departement and need an output like this:
------------------------<24hours---------1day--------2-3days---------- Total
departement A ----------1---------------2----------------2--------------5
departement B-----------3---------------3----------------1--------------7
departement C-----------2---------------2----------------2--------------6
I try to make somethink like this:
select id_departament,
count(decode(creat_date,'sysdate',id_message,null)) "<24 Hours",
count(decode(creat_date,'sysdate',id_message,null)) "1 DAY",
count(decode(creat_date,'sysdate',id_message,null)) "2-3 DAYS",
count(id_message) Total
from V_MESSAGE
group by id_departament
order by id_departament
The problem is , that count(decode(creat_date,'sysdate',id_message,null)) "<24 Hours",
return 0 .........and when i make count(decode(creat_date,'07.12.17',id_message,null)) "<24 Hours", it returns the value of the number of messages in this date .
What's wrong with this sysdate??
Thank's

use case:
case when sysdate - create_date < 1 then '< 24 hours'
     when sysdate - create_date < 2 then '1 day'
     when sysdate - create_date < 4 then '2-3 days'
     else 'over 3 days'
end periodRegards
Etbin
you can group by expression:
  with
  your_table as
  (select id_department,rownum id_message,creat_date
     from (select ceil(dbms_random.value(0,5)) id_department,sysdate - dbms_random.value(0,5) creat_date
             from dual
           connect by level <= 20
           order by creat_date
  groupped as
  (select id_department,
          case when sysdate - creat_date < 1 then '< 24 hours'
               when sysdate - creat_date < 2 then '1 day'
               when sysdate - creat_date < 4 then '2-3 days'
               else '3+ days'
          end period,
          count(*) the_count
     from your_table
    group by id_department,
             case when sysdate - creat_date < 1 then '< 24 hours'
                  when sysdate - creat_date < 2 then '1 day'
                  when sysdate - creat_date < 4 then '2-3 days'
                  else '3+ days'
             end
  pivoted as
  (select id_department,
          max(decode(period,'< 24 hours',the_count,null)) "< 24 hours",
          max(decode(period,'1 day',the_count,null)) "1 day",
          max(decode(period,'2-3 days',the_count,null)) "2-3 days",
          max(decode(period,'3+ days',the_count,null)) "3+ days"
     from groupped
    group by id_department
  select id_department,"< 24 hours","1 day","2-3 days","3+ days",
         nvl("< 24 hours",0) + nvl("1 day",0) + nvl("2-3 days",0) + nvl("3+ days",0) total 
    from pivoted
   order by id_department
=====================================================
ID_DEPARTMENT|< 24 hours|1 day|2-3 days|3+ days|TOTAL
=====================================================
            1|         1|     |       3|      1|    5
            2|          |    2|       1|       |    3
            3|         1|     |       1|       |    2
            4|          |     |       1|      2|    3
            5|         2|    1|       4|       |    7Regards
Etbin
Message was edited by:Etbin
user596003

Similar Messages

  • Discoverer Report  returning ' no data  found '

    Hi  ...
    i  have an issue with one discoverer  report  .
    Discoverer report  name : EDI Price Exception Report.
    when i ran the report  in Discoverer  Desktop edition  It is returning 'No Data Found ' But  i am taken the  Query from admin edition  and tried to  ran in  PL/SQL Developer/TOAD  by setting  Org_id condition
    it's returning Data  . the Desktop Edition of Discoverer for  some specific date  Range  it's giving Data  But  from last month on wards  it's not returning any Data.
    in Discoverer Report  Desktop  it's not retuning the Data from  November to till date
    Oracle  Applications  11i
    Discoverer 4i
    Oracle Data base :9i 
    OS : Windows.
    Attached the Sql  which i used to generate the Report :
    I HAVE USED THE FOLLOWING  :-for initialize the profile options
    EXEC FND_GLOBAL.APPS_INITIALIZE (0,52163,660);
    EXEC APPS.FND_CLIENT_INFO.SET_ORG_CONTEXT(2922);
      SELECT A.CUST_PO_NUMBER,
             A.ORDER_NUMBER,
             A.ORDERED_DATE,
             A.ORDER_TYPE,
             -- C.CUSTOMER_ID,
             C.CUSTOMER_NUMBER,
             C.CUSTOMER_NAME,
             B.LINE_NUMBER,
             B.ORDERED_ITEM,
             MSI.SEGMENT1 ACCO_ITEM,                               -- GRW 20060407
             MSI.DESCRIPTION,
             -- MSI.INVENTORY_ITEM_ID,
             (SELECT MCI.CUSTOMER_ITEM_NUMBER
                FROM MTL_CUSTOMER_ITEMS MCI,
                     MTL_CUSTOMER_ITEM_XREFS MCIX,
                     MTL_SYSTEM_ITEMS_B MSIB
               --  MTL_PARAMETERS          MP
               WHERE     MCI.CUSTOMER_ID = C.CUSTOMER_ID                 --1814924
                     AND MCI.CUSTOMER_ITEM_ID = MCIX.CUSTOMER_ITEM_ID
                     AND MCIX.INVENTORY_ITEM_ID = MSIB.INVENTORY_ITEM_ID
                     AND MSIB.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID   --869899
                     AND MSIB.ORGANIZATION_ID = MTP.ORGANIZATION_ID --MP.ORGANIZATION_ID
                     AND MTP.ORGANIZATION_CODE = 'BRM'
                     AND MCI.CUSTOMER_ITEM_NUMBER = B.ORDERED_ITEM
                     AND NVL (mci.inactive_flag, 'N') <> 'Y'
                     AND NVL (mcix.inactive_flag, 'N') <> 'Y')
                CUSTOMER_ITEM,
                     XXAB_ITEM_XREFS.GET_GBC_ITEM_NUM (B.ORDERED_ITEM) GBC_ITEM_NUMBER,
             B.ORDERED_QUANTITY,
             B.PRICE_LIST,
             B.UNIT_SELLING_PRICE,
             B.UNIT_LIST_PRICE,
                   TO_NUMBER (B.ATTRIBUTE7) CUST_SENT_PRICE,
             apps.XXAB_CUST_SENT_PRICE_CONV_SO (C.customer_number,
                                                B.ordered_item,
                                                B.header_id,
                                                B.line_number,
                                                B.unit_selling_price,
                                                B.attribute7,
                                                B.pricing_quantity_uom,
                                                B.attribute4)
                CUST_SENT_PRICE_CONVERTED,
             ABS ( (B.UNIT_SELLING_PRICE
                    - apps.XXAB_CUST_SENT_PRICE_CONV_SO (C.customer_number,
                                                         B.ordered_item,
                                                         B.header_id,
                                                         B.line_number,
                                                         B.unit_selling_price,
                                                         B.attribute7,
                                                         B.pricing_quantity_uom,
                                                         B.attribute4)))
                DIFFERENCE,
                      MTP.ORGANIZATION_CODE,
             B.SHIP_TO_LOCATION
        FROM OE_ORDER_HEADERS_V A,
             OE_ORDER_LINES_V B,
             RA_CUSTOMERS C,
             MTL_PARAMETERS MTP,
             MTL_SYSTEM_ITEMS_B MSI
       WHERE     A.HEADER_ID = B.HEADER_ID
             AND A.SOLD_TO_ORG_ID = C.CUSTOMER_ID
             -- Added by Gati on 19-Oct-2012, tkt - INC000000118962
             AND ROUND (TO_NUMBER (apps.XXAB_CUST_SENT_PRICE_CONV_SO (
                                      C.customer_number,
                                      B.ordered_item,
                                      B.header_id,
                                      B.line_number,
                                      B.unit_selling_price,
                                      B.attribute7,
                                      B.pricing_quantity_uom,
                                      B.attribute4)),
                        2) <> B.UNIT_SELLING_PRICE
             --AND ROUND(TO_NUMBER(B.ATTRIBUTE7), 2) <> B.UNIT_SELLING_PRICE
             --AND     a.ship_from_org_id = mtp.organization_id
             AND B.SHIP_FROM_ORG_ID = MTP.ORGANIZATION_ID          -- GRW 20060413
             --AND     a.ship_from_org_id = msi.organization_id
             AND B.SHIP_FROM_ORG_ID = MSI.ORGANIZATION_ID          -- GRW 20060413
             AND B.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID       -- GRW 20060407
             AND A.ORDER_SOURCE_ID = 6
             AND A.ORG_ID = B.ORG_ID
             AND TO_CHAR (A.ordered_date, 'DD-MON-YYYY') between  '01-NOV-2013' and  '03-NOV-2013'
             and mtP.organization_code='BRM'
                      AND A.ORG_ID = (SELECT HOU.ORGANIZATION_ID
                               FROM HR_OPERATING_UNITS HOU
                              WHERE HOU.NAME = '50 ACCO Canada')
             AND B.cancelled_flag <> 'Y'
             AND B.flow_status_code <> 'CANCELLED'
             AND B.ORDERED_ITEM <> 'INVALID_ITEM'
    ORDER BY a.order_number

    Hi,
    Assuming your initialization matches your discoverer login, it is pretty weird that you get no data.
    I am not sure how you got the SQL but i suggest you trace the session to get the exact SQL ran by the discoverer.
    You may find another condition or join that limits your data.
    Also another thing that you should try is to initial the session by using all the parameters (including the security group as you have in your discoverer login):
    begin
      fnd_global.APPS_INITIALIZE(user_id =>, resp_id =>, resp_appl_id =>, security_group_id =>);
    end

  • Discoverer report returns no data from a certain time

    Using Discoverer 10g,a discoverer report which returned data normally last month gets to return no data now.
    We have four same environments, and two of them has this problem, two is OK.
    And the SQL of the discoverer of the four environments are the same.
    We have no any changment of this discoverer and related EUL for more than one year....
    How should we investigate into this issue.
    For example ,a point we should notice or something...
    Could somebody give us a suggestion?
    Thank you.

    Thanks for your qiuck reply.
    1.empty table that is joined in the query.The four environments has almost the same data,it is not the cause.
    2.security issue with the data, maybe the security definitions are different from one environment to another.we are now invesgate into this cause.
    and there is a sql of the discoverer's EUL which shows no data in a enviroment(in this enviroment discoverer report gets no data), but in another enviroment data can show.
    the sql is as following.
    =============
    SELECT loc_bu.org_id
    ,loc_bu.location_id building_id
    ,loc_bu.building building_name
    ,loc_bu.location_code building_number
    ,loc_fl.location_id floor_id
    ,loc_fl.location_code floor_number
    ,loc_fl.floor floor_name
    ,loc_of.location_id office_id
    ,loc_of.location_code office_number
    ,loc_of.office office_name
    ,loc_of.suite office_suite
    ,loc_of.location_alias office_alias
    ,loc_of.assignable_area office_assignable_area
    ,loc_of.space_type_lookup_code office_space_type_code
    ,lst.meaning office_space_type
    ,loc_of.function_type_lookup_code office_function_type_code
    ,fun.meaning office_function_type
    ,(SELECT ffv.description
    FROM fnd_flex_values_vl ffv
    ,fnd_flex_value_sets ffvs
    WHERE ffv.flex_value = loc_of.attribute1
    AND ffv.flex_value_set_id = ffvs.flex_value_set_id
    AND ffvs.flex_value_set_name = 'MB_PN_ON') occupancy_exception_flag
    ,loc_of.active_start_date
    ,loc_of.active_end_date
    --ADD BY KEVIN 2008/6/26 START
    ,loc_of.attribute7 division_code_office
    ,(SELECT ffv.description
    FROM fnd_flex_values_vl ffv
    ,fnd_flex_value_sets ffvs
    WHERE ffv.flex_value = loc_of.attribute7
    AND ffv.flex_value_set_id = ffvs.flex_value_set_id
    AND ffvs.flex_value_set_name = 'MB_PN_DIVISION') division_description_office --ヌヨ-ホ・ヒオテ・
    --ADD BY KEVIN 2008/6/26 END 
    FROM pn_locations loc_bu
    ,pn_locations loc_fl
    ,pn_locations loc_of
    ,fnd_lookups fun
    ,fnd_lookups lst
    WHERE loc_bu.location_id = loc_fl.parent_location_id
    AND loc_bu.location_type_lookup_code IN ('LAND', 'BUILDING')
    AND nvl(loc_bu.attribute6, '99') <> '01'
    AND loc_fl.location_id = loc_of.parent_location_id
    AND loc_fl.location_type_lookup_code IN ('FLOOR', 'PARCEL')
    AND nvl(loc_fl.attribute6, '99') <> '01'
    AND loc_of.location_type_lookup_code IN ('OFFICE', 'SECTION')
    AND nvl(loc_of.attribute6, '99') <> '01'
    AND loc_of.function_type_lookup_code = fun.lookup_code(+)
    AND fun.lookup_type(+) = 'PN_FUNCTION_TYPE'
    AND loc_of.space_type_lookup_code = lst.lookup_code(+)
    AND lst.lookup_type(+) = decode(loc_of.location_type_lookup_code,
    'OFFICE',
    'PN_SPACE_TYPE',
    'SECTION',
    'PN_PARCEL_TYPE')
    AND nvl(loc_of.space_type_lookup_code,'99') <> '07';
    ====================
    Ps.before excute this sql, we always first excute following command.
    ====
    begin
    fnd_client_info.set_org_context(117);
    end;
    ====
    The analyst of our team is not very good at the security problem, could you help us?
    Thanks a lot.

  • Return default data if no data is returned by sql query

    Hi,
    I have a requirement.
    I have an inner query that returns no data. However I still want to return default data (say 'abc'). The below sql does not return anything inspite of using nvl . Please advise .
    select nvl( x.vencode,'abc') vencode
    from
    -- below sql returns no data!
              SELECT a.vencode vencode,
                     a.mid mid,
                     a.title title,
                      ROW_NUMBER() OVER (PARTITION BY a.vencode ORDER BY a.title) rnk
               FROM (
                     SELECT *
                     FROM    (SELECT vencode FROM vendor where login is not null and vencode = 'BKFI'
                                        and login > (sysdate - 90) )
                          CROSS JOIN
                             (SELECT mid, title, ROWNUM num FROM tcommmemos where mid is not null)
                    ) a,        
                   (SELECT * FROM (
                    SELECT v.vencode, tc.mid, tc.title
               FROM
               (select  * from vendor
                     where login is not null and vencode = 'BKFI'
                     and login > (sysdate - 90)) v,
                tcommmemosviewed tcv, tcommmemos tc
               WHERE     v.vencode = tcv.vencode
                     and tc.mid is not null
                     --AND tc.post_date > v.hiredate
                     AND tc.mid = tcv.mid)
                   ) b
                   where a.vencode = b.vencode(+)
                     and a.title   = b.title(+)
                     and a.mid     = b.mid(+)
                     and b.mid is null                               
    ) x              

    Use any aggregate function it'll always return a value even if there no data in the table
    create table r_dummy_1 (a number);
    SQL> select * from r_dummy_1;
    no rows selected
    SQL> select nvl(max(a),1) from r_dummy_1;
    NVL(MAX(A),1)
    1

  • SSRS - Oracle Stored procedure returns no data but does in SQL Developer Sudio

    HI there,
    Stored procedure returns no data when executed on the report but when i execute the stored procedure in Sql Developer it returns required rows.
    Thanks for your help!

    Hi Simon,
    When i test with simple query, i get the data.
    For your convenience, my stored proc looks lyk :
    PROCEDURE pr_REPORT_data(P_STARTDATE IN DATE, P_ENDDATE IN DATE, data_rows OUT T_CURSOR) AS 
    OPEN completed_Reinstatement FOR
      SELECT 
                 value1,.......value5
      FROM table1
    WHERE
        To_Date(createdDate, 'YYYY/MM/DD') BETWEEN To_Date(P_STARTDATE, 'YYY/MM/DD') AND To_Date(P_ENDDATE, 'YYYY/MM/DD');
    END pr_REPORT_data;          
    T_CURSOR is of type cursor which is declared on the package.
    I'm assuming the problem is with date parameters, however i converted the date before passing to
    WHERE clause. 

  • Returns No Data Found

    Hi i have a query like this
    SELECT
    pro.project_name "Project Name",
    POBJ.NAME "Object Name",
    X."Major" "Internal Major",
    X."Minor" "Internal Minor",
    X."Normalized" "Internal Normalized",
    X."IDR" "Internal Defect Rate",
    Y."Minor" "External Minor",
    Y."Major" "External Major",
    Y."Normalized" "External Normalized",
    Y."EDR" "External Defect Rate",
    NULL "Total Defects"
    FROM
    PROJECTS PRO,
    PROJECT_OBJECTS POBJ,
    (SELECT
    MN."PRO_ID",
    MN."POBJ_ID",
    MN."Major",
    MN."Minor",
    MN."Normalized",
    DR."IDR_PRO_ID",
    DR."IDR_POBJ_ID",
    DR."IDR"
    FROM
    MAJOR_MINOR_NORMALIZED MN FULL OUTER JOIN IDR DR
    ON
    MN."PRO_ID" = DR."IDR_PRO_ID" AND
    MN."POBJ_ID" = DR."IDR_POBJ_ID" ) X,
    (SELECT
    EE."PRO_ID" EE_PRO_ID,
    EN."PRO_ID" EN_PRO_ID,
    EE."POBJ_ID" EE_POBJ_ID,
    EN."POBJ_ID" EN_POBJ_ID,
    EN."Major" "Major", EN."Minor" "Minor", EN."Normalized" "Normalized",
    EN."Normalized" / DECODE(EE."External_Effort",0,NULL,EE."External_Effort") "EDR"
    FROM
    EXTR_MAJOR_MINOR_NORMALIZED EN FULL OUTER JOIN EXTERNAL_EFFORT EE
    ON
    EE."PRO_ID" = EN."PRO_ID" AND
    EE."POBJ_ID" = EN."POBJ_ID") Y
    WHERE
    PRO.ID = 2673 AND
    2673 = POBJ.PRO_ID AND
    2673 = DECODE(X."PRO_ID",NULL,2673,X."PRO_ID") AND
    2673 = DECODE(X."IDR_PRO_ID",NULL,2673,X."IDR_PRO_ID") AND
    POBJ.ID = DECODE(X."POBJ_ID",NULL,POBJ.ID,X."POBJ_ID") AND
    POBJ.ID = DECODE(X."IDR_POBJ_ID",NULL,POBJ.ID,X."IDR_POBJ_ID") AND
    2673 = DECODE(Y."EE_PRO_ID",NULL,2673,Y."EE_PRO_ID") AND
    2673 = DECODE(Y."EN_PRO_ID",NULL,2673,Y."EN_PRO_ID") AND
    POBJ.ID = DECODE(Y."EE_POBJ_ID",NULL,POBJ.ID,Y."EE_POBJ_ID") AND
    POBJ.ID = DECODE(Y."EN_POBJ_ID",NULL,POBJ.ID,Y."EN_POBJ_ID")
    In the above query all the X Contents have data and Y Contents are not having data but i need to display if X contents are there and make Y contents as Blank if no data exists
    The Query will return value ony if the data existing both X and Y
    if either one of the X or Y having data it will return no data found how to give the where clause condtion for such cases i tryed many ways was not able to get the result
    thanks
    Sudhir

    I did like this
    Create or Replace View IDRS as
    SELECT
    MN."PRO_ID",
    MN."POBJ_ID",
    MN."Major",
    MN."Minor",
    MN."Normalized",
    DR."IDR_PRO_ID",
    DR."IDR_POBJ_ID",
    DR."IDR"
    FROM
    MAJOR_MINOR_NORMALIZED MN FULL OUTER JOIN IDR DR
    ON
    MN."PRO_ID" = DR."IDR_PRO_ID" AND
    MN."POBJ_ID" = DR."IDR_POBJ_ID
    CREATE OR REPLACE FORCE VIEW "EXTERNAL_DEFECT_RATE" ("EE_PRO_ID", "EN_PRO_ID", "EE_POBJ_ID", "EN_POBJ_ID", "Major", "Minor", "Normalized", "External_Effort", "EDR") AS
    SELECT
    EE."PRO_ID" EE_PRO_ID,
    EN."PRO_ID" EN_PRO_ID,
    EE."POBJ_ID" EE_POBJ_ID,
    EN."POBJ_ID" EN_POBJ_ID,
    EN."Major", EN."Minor", EN."Normalized",EE."External_Effort",
    EN."Normalized" / DECODE(EE."External_Effort",0,NULL,EE."External_Effort") "EDR"
    FROM
    EXTR_MAJOR_MINOR_NORMALIZED EN FULL OUTER JOIN EXTERNAL_EFFORT EE
    ON
    EE."PRO_ID" = EN."PRO_ID" AND
    EE."POBJ_ID" = EN."POBJ_ID"
    now i am trying to create a full outer join i am getting errors like this
    Select *
    from
    EXTERNAL_DEFECT_RATE edr full outer join on IDRS
    on
    idrs."pro_id" = edr."EE_PRO_ID" and
    simileare other join condtion
    but i get Column Ambigiously defined error
    tx
    Sudhir

  • Discoverer 10g, it returns no data

    Hi all,
    I have a doubt can any one clarifies.
    Currently I work migration projects from 4i to 10g discoverer reports (Upgraded 11i to R12). Previously in 4i discoverer reports many views used and data also populated. Same query in discoverer 10g, it returns no data. I can view the data after setting client org id in the toad but can’t view the data in the discoverer reports. Even I tried to register as a function for setting client org id and use in the discoverer reports but result is no rows return. Can any one suggest?
    Regards,
    Prasanna
    no data

    Hi,
    Check Metalink Note 732826.1. There are some extra steps need to configure R12 with Discoverer.
    Rod West

  • Report Script returns no data and "java.io.FileNotFoundException" error

    When attempting to write to a new file (Eg: C:\TEST.txt), Report Script returns no data and "java.io.FileNotFoundException" error occurs.
    This error occurs only in Essbase 9.3.1.3 release, however it works fine in release 9.3.1.0.
    After running the report the script, it pops up the follwing message:
    "java.io.FileNotFoundException: ..\temp\eas17109.tmp (The system cannot find the file specified): C:\TEST.txt"
    When checked the TEST.txt, it was empty.

    Sorry folks, I just found out the reason. Its because there was no data in the combination what I was extracting.
    but is this the right error message for that? It should have atleast create a blank file right?

  • Tax Report Returns No Data [Message 131-85]

    Our client has been using SBO for the past few years and run the Standard Tax Report.
    They follow a standard procedure whereby they open the Tax Report enter the period details and click OK, the report returns all Input and Output Tax details.
    This month they have run the report and no matter what dates you enter the report returns No Date [Message 131-85]
    Does anyone have any clues as to what might be causing this?

    I have discovered via a SQL trace that the following script is tun for the tax report
    exec sp_executesql N'
    SELECT      T0.[AbsEntry],
         T0.[Code],
         MIN(T0.[Name]),
         T0.[SrcObjType],
         T0.[DocNum],
         MIN(T0.[Category]),
         MIN(T0.[IsEC]),
         T0.[IsAcq],
         MIN(T0.[VatPercent]),
         MIN(T0.[EqPercent]),
         T0.[DocDate],
         MIN(T0.[TaxDate]),
         MIN(T0.[CANCELED]),
         SUM(T0.[BaseSum]),
         SUM(T0.[VatSum]),
         SUM(T0.[EqSum]),
         SUM(T0.[DeductSum] - T0.[EqSum]),
         MIN(T0.[SrcObjAbs]),
         N''0'',
         0,
         0,
         MIN(T0.[DocDate]),
         0,
         0,
         MIN(T0.[NumAtCard]),
         SUM(T0.[BaseSumSc]),
         SUM(T0.[VatSumSc]),
         SUM(T0.[EqSumSC]),
         SUM(T0.[DedctSumSC] - T0.[EqSumSC]),
         MIN(T0.[TaxType]),
         T0.[CrditDebit],
         MIN(T0.[CardCode]),
         MIN(T0.[CardName]),
         MIN(T0.[SrcLineNum]),
         MIN(T0.[VatDate]),
         MIN(T0.[VatIdUnCmp]),
         MIN(T0.[LicTradNum]),
         MIN(T0.[BPLicTradNum]),
         MIN(T0.[AddID]),
         SUM(T0.[BaseSum])
         FROM  [dbo].[B1_VatView] T0 
         WHERE (T0.[Code] = (@P1)  OR       
         T0.[Code] = (@P2)  OR 
         T0.[Code] = (@P3)  OR 
         T0.[Code] = (@P4)  OR 
         T0.[Code] = (@P5)  OR 
         T0.[Code] = (@P6)  OR 
         T0.[Code] = (@P7)  OR 
         T0.[Code] = (@P8)  OR 
         T0.[Code] = (@P9)  OR 
         T0.[Code] = (@P10)  OR 
         T0.[Code] = (@P11)  OR 
         T0.[Code] = (@P12) ) AND 
         T0.[DocDate] >= (@P13)  AND 
         T0.[DocDate] <= (@P14)  
         GROUP BY T0.[AbsEntry], T0.[Code], T0.[SrcObjType], T0.[DocNum], T0.[IsAcq], T0.[DocDate], T0.[CrditDebit]
         ORDER BY T0.[IsAcq] DESC,T0.[CrditDebit]',N'@P1 nvarchar(30),@P2 nvarchar(30),@P3 nvarchar(30),@P4 nvarchar(30),@P5 nvarchar(30),@P6 nvarchar(30),@P7 nvarchar(30),@P8 nvarchar(30),@P9 nvarchar(30),@P10 nvarchar(30),@P11 nvarchar(30),@P12 nvarchar(30),@P13 datetime2,@P14 datetime2',N'SEXP',N'SFRE',N'SGST',N'SNT',N'PCAF',N'PCAP',N'PFRE',N'PGNR',N'PGST',N'PGSTV',N'PNT',N'PPRI','2010-03-01 00:00:00','2010-03-31 00:00:00'
    If I run this in SQL I get the following error, which mat shed some light on what is happening
    Msg 2715, Level 16, State 3, Line 1
    Column, parameter, or variable #13: Cannot find data type datetime2.
    Parameter or variable '@P13' has an invalid data type.
    Msg 2715, Level 16, State 3, Line 1
    Column, parameter, or variable #14: Cannot find data type datetime2.
    Parameter or variable '@P14' has an invalid data type.

  • Report returns wrong data when run on server

    Hi,
    I'm runing CRS XI R2 on Windows Server 2003 SP2.  When I refresh a report in the Crystal Reports XI Designer, I'm getting correct data.  But when I schedule the report to run on the server it returns wrong data.  The data is different from what I see when I refresh it from the designer.  In the report I have running totals set up to count customers that meet a certain criteria.  The report is very large.  It take almost 2 hours to refresh.
    I was wondering what is causing the difference in running total data between refreshing it on the designer and running it on the server.  Is it returning wrong data b/c of it not reading all the records?  Should I be making any changes to the server settings?  I saw that under pageserver, there are options for  setting the 'Minutes Before an Idle Report Job is Closed' and 'Database Records To Read When Previewing Or Refreshing a Report".  Do either of those have anything to do with the report returning incorrect data when being scheduled to run on the server?
    Thanks,
    Kim

    Hi Xuandao,
    You would need to Use Cell Binding and Trigger concept to accomplish this.
    Its simple, however, you would have to work on a trial and error basis to understand this concept as implementing the same is subject to your dashboard and WEBI Design.
    Open you LiveOffice.
    Insert your WEBI, Now, go to Object Properties of your WEBI, select the second tab that says Prompt, Here, it lists the prompts that you have for your WEBI. This would also enlist your BEx variables as well. Select this BEx variable and click on the button that says Prompt at the bottom of this window. Here, select choose Excel Data Range and click on the cell select button on the right (small button that lets you choose what cell you want to bind this prompt to), Now select a free cell that would not be even populated later on when you run the dashboard say A1 (remember the value that you select). Click on OK and again OK. The WEBI Refreshes and you can see all the prompt values at the cell A1. These are all the possible values stored for your BEx prompt variables (these values are fetched from BW system dynamically).
    Now, save this LiveOffice, Go to you dashboard. Connect your dashboard to your Live office. Go to Data-> connections-> Now, select the WEBI and in the right hand pane  go to Usage tab, here, Click on Trigger cell button on the right hand side and select A1 in you LiveOffice.
    It should work fine.
    Let me know.
    Rgds,
    Sreekul Nair

  • Report with two Command is empty if one of the two commands returns no data

    Hi all,
    I have a report with two Commands not linked together.
    If ONLY one of the two Commands returns no data, the full report is empty (although the other Command returns data).
    I'm using Crystal Report 2008 and the CRJ 12.2.205
    Have an idea?

    Hi Ted,
    how can I solve the problem, please? It is important.
    If I can help yourself, the problem is appeared in many reports since I updated the library (the old library version 11.8.4.1094 works fine with all). I'm waiting for your answer, please.
    Thank you very much.

  • CSV spreadsheet returning "no data found"

    Hi,
    In one of the reports, I enabled CSV Output so the report can be downloaded.
    When I download it, using Excel 2000, I have no problem, I can see all the right data.
    However, one of my user, who uses Excel 2002, when saves the file and opens it, returns "no data found" on screen.
    Is this an Excel issue? Is Apex not compatible with Excel 2002? Please advise.
    Thanks!

    Do you have any items on your report page, which you use as a condition for the report? Eventually, you need to compute those items on load. If I remember correctly that was the problem I had before.
    Denes Kubicek

  • Failed to open the connection, when view returns no data.

    Hi Guys,
    I'm having a minor issue.
    I'm running a report in the crystalreportsviewer in asp.net.
    The report is retrieving it's data from a view.
    The report also has a subreport with an overview with totals, using the same view and the same parameters as the primary report.
    Now everything is working fine in a filled database.
    But when the view does not return any data, i get the following error:
    Failed to open the connection. Failed to open the connection. Details:
    [Database Vendor Code: 53 ] Failed to open the connection. Details:
    [Database Vendor Code: 53 ] Failed to open the connection.
    Freight_Charges_By_Branch_By_Period_By_Customer {9D0460D7-5C9E-  4FD5-B190-AFD41693A143}.rpt
    Can anyone please help me with this problem.
    Thanks in advance!
    Regards William

    Lot of important info missing here:
    1) What version of CR?
    2) What CR updates have you applied?
    3) What version of .NET?
    4) Is this on your dev box or after you deploy?
    5) Have you looked up error code 53 for your database? (This is the error code CR engine is simply passing through from the db client)
    6) What is the database?
    7) What connection method are you using?
    8) Depending on the version of CR, can you run this report in the CR designer?
    9) Copy and paste the code used to run the report.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • CR 2008 Advanced Chart in Report Header -Returning Repeated Data

    Very new to CR. I've a situation i need some assistance with. I have an advanced chart located in a report header. the chart is sourcing data from a stored procedure call. the stored procedure returns timeseries data (timestamp, value) for a one month period, thirty values. There are many columns in the result set but i'm trending only two of tehm in the trend.
    Problem is that, although the data set has only thirty values, when I view the trend visually the data is repeated many times over. So i'll see the data for the dates 1...30, then 1...30, many times over. If I zoom into the trend I can get to a point where there's a single month of data in the extents but this isn't the desired behaviour; i want to see only the 30 values plotted.
    configuration is,
    Advanced Chart -Line chart format-
    "For each record"
    (Date Time Field)
    "Show Values"
    (Series Data Field)
    I've confirmed  using Field Explorer / browse data that there are only thirty values in the result set. What am I overlooking here?

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Query for file version less than 10.0 does not return expected data

    I'm trying to build a query for all PCs that have a version of Iexplore.exe in c:\windows\program files\ that is less than 10.0 .  When I run the query it returns no data. When I change 10.0 in the query to 9.9 it returns files with version 10.xxx in
    the results.  Its as if it is seeing 10.0 as 1.0.   Is this expected ?
    select SMS_R_System.Name, SMS_R_System.ADSiteName, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where
    SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath = "C:\\program files\\internet explorer\\" and SMS_G_System_SoftwareFile.FileVersion < "9.9"

    It is because the values are not integer, they are a string. And therefore 1 is smaller then 9.
    http://www.enhansoft.com/

  • How to Include Warnings/Error messages in Return Service Data Object

    Hello All,
    I am using Jdeveloper 11.1.1.3.0, ADF BC. and want to publish Service-Enabled application modules, specifically I want to publish a custome method in the application module as a web service.
    While going through Enable support for Service Interface wizard as explained in developer guide, in step 7 I read this
    >
    7. To expose service information messages such as warnings and exceptions for a custom method or warnings for process operation methods, select Include Warnings in Return Service Data Object. For example, you might want display an informational message when a method returns the total employee compensation and the total is outside of the desired range.
    If Include Warnings is not selected, no informational messages will be returned with the service response. This option is only enabled when the method does not return a view row or a list
    of view rows. When the method returns view rows, the underlying view object determines whether the method supports warnings, as described Section 11.2.4, "How to Service-Enable Individual View Objects." The informational messages (and warnings) are reported as part of the return object. JDeveloper generates appropriate wrappers as the return objects, and the wrappers contain the actual method return and the informational messages.
    >
    I am interested in this part: For example, you might want display an informational message when a method returns the total employee compensation and the total is outside of the desired range.
    To do this, I write a method in the application module
    public Number getEmpSal(Number empId){
            EmployeesViewImpl employeesView1 = this.getEmployeesView1();
            //this is the bind variable setter
            employeesView1.setEmpId(empId);
            employeesView1.executeQuery();
            EmployeesViewRowImpl first = (EmployeesViewRowImpl)employeesView1.first();
           return first!=null ? first.getSalary() : null;
    }and I selected the Include Warnings in Return Service Data Object check box. but how and where can I expose the error or warning message?
    Note:
    I tried to throw an exception in the method
    public Number getEmpSal(Number empId){
            EmployeesViewImpl employeesView1 = this.getEmployeesView1();
            //this is the bind variable setter
            employeesView1.setEmpId(empId);
            employeesView1.executeQuery();
            EmployeesViewRowImpl first = (EmployeesViewRowImpl)employeesView1.first();
            if(first!=null && (first.getSalary()!=null || first.getSalary().compareTo(1000)==1))
                throw new JboException("out of range salary");
             return first!=null ? first.getSalary() : null;
    }and when I test the web service for some employee I get this response:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
         <env:Body>
              <env:Fault>
                   <faultcode>env:Server</faultcode>
                   <faultstring>out of range salary</faultstring>
                   <detail><tns:ServiceErrorMessage xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/" xmlns:xsi=      "http://www.w3.org/2001/XMLSchema-instance"><tns:code/><tns:message>out of range  salary</tns:message><tns:severity>SEVERITY_ERROR</tns:severity><tns:exceptionClassName>oracle.jbo.JboException</tns:exceptionClassName></tns:ServiceErrorMessage>
                   </detail>
              </env:Fault>
         </env:Body>
    </env:Envelope>but is this the right approach or there is another place to show error/warning messages?
    Edited by: Mohammad Jabr on Apr 16, 2012 1:17 PM

    This is fine if you raise exception from your code. It will be raised as a server fault only.

Maybe you are looking for

  • Asset (Machine) Transfer with in Company code (Different Business area)

    Dear all Please provide us transaction code and document flow for inter plant transfer of assets t. All required entry of MM, PM, FI and excise should be covered in the document process. Inter u2013plant & inter-company assets transfer/sale is common

  • Comments rolling off the page

    OK, ironically I actually am having a problem with comments that is different from the one problem that I have seen all the posts on. A friend of mine sent me a document to review and as I started to make comments and suggest syntactical changes the

  • New Logical Column using repository variables

    Hello all, Can anyone let me know how we create a new logical column in OBIEE 11g in the BMM layer using the repository variables..Is there any way/chance to create such new logica columns.If so please let me know how we will be doing that

  • Music played in iTunes crackles

    Hi. Basically my problem is the above - when I play music in iTunes, it crackles and there's general interferencey noises. When I play music in WMP, no crackles. This is the same for mp3 and aac files. Anyone know how to help? Fujitsu-Siemens Amilo A

  • HOW TO MARK MULTIPLE FACES

    i am facing problems in marking multiple faces and also evrytime i open iPhoto i get the message "5 photos have been found in the iPhoto library that were not imported." but i never find the photos and there is addition in recovered photos