Running SQL and Reports in Multiple LMS's

Hi,
We have an Oracle ilearning implementation that covers a number of subjects. The Ilearning system/database is partioned for each subject with each subject having the same schema and database objects. The only thing that is different is the data within the tables etc... I occasionally have to run SQL reports on all these partitioned databases. The only I can do this is to switch context from subject partition to subject partition. I was wondering if there is a quick way (one time SQL execution) to run the SQL report against all the partitions we have in total 18 subject partitions. Not having this ability means I have to run the same SQL multiple times which is a very time consuming exercise. I would preferably like to do this at the database end using SQL developer.
Your help and advice will be greatly appreciated.
Thanks

Hi Scott,
Yes you are right I am referring to site. At the moment I have been created a 'user' that has access to the database objects in the ILEARN schema via synonyms. So this means having access to the ILEARN schema will allow me to use one single piece of SQL to report accross the 18 different sites we have and pull all the data into a single report. Currently, I have to report site by site and have 18 outputs for each SQL I run. We have to run 4 SQL statements and I'd rather have 4 outputs with all 18 site data in each of these outputs.
Thanks

Similar Messages

  • Long Running SQL and ORDS Spawns Multiple Database Sessions

    Hi all.
    We have a strange situation when accessing a long running SQL Report (a single APEX Page).
    The SQL takes about 15 mins to run but when I monitor what database sessions are spawned by the APEX Listener, I see multiple sessions all executing the same SQL. It appears that after 6 minutes, the APEX Listener spawns a new database session to execute the same SQL.
    Has anyone seen this before and if so, is there a key setting I am missing as I don't want this to happen. I am new to the APEX Listener and WebLogic so apologies if this is the way it's meant to work but it seems odd that after a certain amount of time (6 minutes in my case) a new database session is spawned to do the same work.
    We are running:
    WebLogic: 10.3.0.6
    APEX_LISTENER_VERSION 2.0.0.354.17.06
    Datadate: 11.2.0.3.0 Production
    APEX: 4.2.1.00.08
    Cheers for any help.
    Duncs

    Hi Duncan,
    With all respect, you should please rethink your interface.  I would never consider writing a Web application with a request that knowingly takes 15 minutes to return the results.  You can consider doing this asynchronously via DBMS_SCHEDULER and then alerting the user (via email, perhaps) that their results are ready.  Or if you can precompute this in advance, consider using materialized views so that the user's response time is sub-second.
    In an era where the patience of the average end-user is measured in single-digit seconds, it is impractical to ever expect an end-user to wait 15 minutes for their resultant Web page.
    Joel

  • Adpatch: Error running SQL and EXEC commands in parallel

    Hi
    I am applying R12 RUP2 to an instance at the moment. I had an OS crash (I'm running R12 on Linux on VMWARE) and on reboot attempted to restart the patch.
    I now get an error as follows:
    Error running SQL and EXEC commands in parallel
    I must admit, I'm not a DBA, so if anyone has any ideas or has seen this before then it would be most appreciated!
    Thanks
    Chris

    Hi Adith
    The patch is 5484000, RUP 2 for E-Business Suite R12
    Here's the adpatch output:
    Start date: Wed Sep 12 2007 15:15:14
    0 "left over" javaupdates.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    0 patches uploaded from the ADPSV format patch history files: Wed Sep 12 2007 15:15:14
    Uploading information about files copied during the previous runs ...
    0 "left over" filescopied_<session_id>.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    ****************** E N D O F U P L O A D ******************
    End date: Wed Sep 12 2007 15:15:14
    Already asked for the name of the patch directory.
    (The answer was: /oracle/patches/5484000)
    Already asked for the name of the patch driver file.
    (The answer was: /oracle/patches/5484000/u5484000.drv)
    Reading release list save file...
    Done reading release list save file
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    Turning off actions that reference unrecognized products.
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    End of unrecognized products checking.
    (The number of parallel workers is: " 2 ")
    AutoPatch will run in parallel mode.
    Did not need to apply new applterr.txt.
    Skipping...
    Determine directories to create for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine Oracle Reports libraries to generate for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine if need to generate message files for Specified driver
    since no such action is present for this driver file
    Skipping...
    Create Directories for Specified driver
    since no such action is present for this driver file
    Number of invalid objects: 31057
    Running SQL scripts and EXEC commands...
    Determining which SQL and EXEC commands to run...
    Validating PL/SQL direct execute exceptions file ...
    Done validating PL/SQL direct execute exceptions file.
    SERVICE_NAME/INSTANCE_NAME : [VIS]
    connect_string : [(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ebusr12.chriseebee.me.uk)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=VIS)))]
    Done determining which SQL and EXEC commands to run.
    Running SQL and EXEC commands in parallel...
    Creating the AD_UTIL_PARAMS table...
    Table AD_UTIL_PARAMS already exists, so dropping the table and recreating it.
    Creating FND_INSTALL_PROCESSES table...
    Already created fnd_install_processes table
    Already created FND_INSTALL_PROCESSES_U1 index.
    Already created AD_DEFERRED_JOBS table
    Already created AD_DEFERRED_JOBS_U1 index.
    Writing dependencies of jobs to run to appldep.txt file...
    There are now 7569 jobs remaining (current phase=A0):
    0 running, 5 ready to run and 7564 waiting.
    Reading completed jobs from restart file (if any).
    There are now 3474 jobs remaining (current phase=A18):
    0 running, 1 ready to run and 3473 waiting.
    Determining which java executables are supported by adJavaWorker...
    Starting worker processes.
    Worker process 1 started.
    Worker process 2 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Running: file adobjcmp.sql on worker 1 for product ad username APPLSYS.
    AutoPatch error:
    The worker should not have status 'Running' or 'Restarted' at this point.
    Telling workers to quit...
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    All workers have quit.
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    You should check the file
    /oracle/VIS/apps/apps_st/appl/admin/VIS/log/adpatch.log
    for errors.

  • Error message:render error while running sales and reports

    r message:render error while running sales and reports.
    how do you fix it?

    Hello,
    Thanks for your post.
    I can't find any useful information based on the error message. Could you please elaborate your scenario with more detail? In addition, please help to collect detail log information regarding this issue.
    If this issue occured while view a SSRS report, please take a look at the following artice:
    How to diagnose issues when running reports in the report server?
    http://blogs.msdn.com/b/lukaszp/archive/2007/01/31/how-to-diagnose-issues-when-running-reports-in-the-report-server.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • Running Forms and Reports 6i on Windows Server 2003

    Hello,
    Has anyone managed to get Forms and Reports 6i (running on 9iAS web) to run succesfully on Windows Server 2003? If so would you mind sharing what you needed to do to get it to work. I don't care about any of the other components of 9iAS other than forms and reports. Also is it possible to run on the 64bit version of this OS?
    The problem I'm encountering (on the 64bit version of Windows) is that I can't get our webforms to launch any reports. The forms run just fine. I can run the report manually using rwrun60.exe and entering all the parameters by hand. BUT when I run the report from within the form a rwrun60.exe process starts and runs at full cpu. After a bit it dies but the form still continues to wait for it. The only way to get out is to close the browser and forcefully kill the form instance. If anyone has any ideas on what this could be any help is appreciated.
    Thanks

    Hi Jan,
    I haven't tried to run Forms and Reports on Windows Server 2003, but I have worked on Windows XP and UNIX with F/R 6i 9i and 10g. I never had much luck with 9i Forms and Reports, 10g rel 1 was better, but 10g rel 2 is best. I recommend you bite the bullet and convert to 10g AS, Forms & Reports 10g rel 2. After running your 6i F/R to 10g through the converter, you may need to adjust fonts and colors.
    Regarding your specific question, I am surprised that the rwrun60 works at all with 9i AS. And rwrun90 probably won't run the 6i version of your reports without recompiling in the 9 version.
    Hope this helps,
    Frank

  • Error running SQL and EXEC commands in parallel when adpatch

    Hi,
    AutoPatch error:
    aiprfp: product 'cle' not in release 'R120'
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    Freeing includes hash table
    Freeing fixes hash table
    Freeing basedons hash table
    Freeing entities hash table
    You should check the file
    /a02/prod/apps/apps_st/appl/admin/PROD/log/adpatch_7305220_1.log
    for errors.
    How to resolve this errror while applying patch 7305220.
    Regards,

    Hi,
    Please check logfile */a02/prod/apps/apps_st/appl/admin/PROD/log/adpatch_7305220_1.log* for any errors recoded.
    Post error messages from this logfile.This is the main patch log file and it should show the same error "aiprfp: product 'cle' not in release 'R120'".
    Thanks,
    Hussein

  • Error running SQL and EXEC commands in parallel

    Dear Gurus,
    We are applying 3480000 and in process as soon as workers start it come out of adpatch session and give su the following error:
    ************* Start of AD Worker session *************
    AD Worker version: 11.5.0
    AD Worker started at: Sun Sep 02 2007 23:11:01
    APPL_TOP is set to /sgmtemp/prodappl
    Worker process 4 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Done reading jobs from FND_INSTALL_PROCESSES table ...
    Telling workers to read 'todo' restart file.
    Done.
    Starting phase 0 (A0): first
    There are now 98197 jobs remaining (current phase=A0):
    0 running, 123 ready to run and 98074 waiting.
    Assigned: file adsysapp2.sql on worker 1 for product admin username APPLSYS.
    Assigned: file cssruwq1.sql on worker 2 for product cs username CS.
    Connecting to CSD......Unable to connect.
    AutoPatch error:
    The following ORACLE error:
    ORA-01017: invalid username/password; logon denied
    occurred while executing the SQL statement:
    CONNECT CSD/*****
    AutoPatch error:
    Error while evaluating "Check Object"
    Telling workers to quit...
    3 workers have quit. Waiting for 1 more.
    All workers have quit.
    Error running SQL and EXEC commands in parallel
    You should check the file
    /sgmtemp/prodappl/admin/msbep004/log/3480000_sbm3.log
    for errors.
    applmgr@21:/sgmtemp/Oglupgr/3480000>
    What could be the issue, i tried to connect CSD/CSD in sql and it connected.
    Thanks in Advance
    Regards
    Kiran Rana

    Hi Gurus,
    Even i tried to recreate the FND_GLOBAL by performing the following, but still no luck:
    output for scripts hearder value in FND_TOP:
    applmgr@21:/sgmtemp/prodcomn/temp> cd $FND_TOP/patch/115/sql
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> grep Header AFSCGBL*
    AFSCGBLB.pls:/* $Header: AFSCGBLB.pls 115.78 2005/03/21 11:40:02 vbalakri ship $ */
    AFSCGBLS.pls:/* $Header: AFSCGBLS.pls 115.33 2004/06/30 05:00:18 rsheh ship $ */
    Output for script header value in Database:
    SQL> select text from dba_source where name='FND_GLOBAL' and line <5;
    TEXT
    package FND_GLOBAL as
    /* $Header: AFSCGBLS.pls 115.33 2004/06/30 05:00:18 rsheh ship $ */
    package body FND_GLOBAL as
    /* $Header: AFSCGBLB.pls 115.78 2005/03/21 11:40:02 vbalakri ship $ */
    8 rows selected.
    We tried to re-apply 4 hours back when one of the support personnal ask use to run those
    scripts. one of them went with out any errors but second one went with errors
    as follows:
    First Script @AFSCGBLS.pls
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> sapps @AFSCGBLS.pls
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 3 03:24:10 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    DOC> | Copyright (c) 1993 Oracle Corporation Redwood Shores, California, USA|
    DOC> | All rights reserved. |
    DOC> +=======================================================================+
    DOC> | FILENAME
    DOC> | AFSCGBLS.pls
    DOC> |
    DOC> | DESCRIPTION
    DOC> | PL/SQL specification for package: FND_GLOBAL
    DOC> |
    DOC> | NOTES
    DOC> | This module is called by AutoInstall (afplss.drv) on install and
    DOC> | upgrade. The WHENEVER SQLERROR and EXIT (at bottom) are required.
    DOC> |
    DOC> | HISTORY
    DOC> | June, 1999 - Added function AUDIT_ACTIVE, bug 879630. Jan Smith.
    DOC> | 11/19/01 MSkees - Added DBDrv line and 'SET VERIFY OFF' for ARU auto
    DOC> | generation bug 2047263 build
    DOC> |
    DOC> *=======================================================================*/
    Package created.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Second Script AFSCGBLB.pls:
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> sapps @AFSCGBLB.pls <
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 3 03:27:15 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Warning: Package Body created with compilation errors.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 -
    Production
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql>
    The second script (AFSCGBLB.pls) run's out with errors and changes status of almost 15000 objects as INVALID in database.
    Regards
    Kiran Rana

  • How to fix a report textbox aggregate expression error in SQL server reporting with multiple datasets?

    I have a SQL Server Reporting Services report that has a textbox within a Report with variations of the following expression 
    =Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) 
    and 
    Iif(Fields!PointID.Value = 500, 1, 0)) / Sum(Iif(Fields!PointID.Value = 500, 1, 0)) 
    I see the following error when I try to preview the report: 
    The Value expression for the text box ‘Textbox2’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset. 
    What am I missing in this this expression to make it run incorrectly

    Can you include dataset name in your sum functions? e.g. Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) 
    and 
    Iif(Fields!PointID.Value = 500, 1, 0)) should include your dataset name as Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) and Iif(Fields!PointID.Value = 500, 1, 0),"datasetname")Like wise  Sum(Iif(Fields!PointID.Value = 500, 1, 0))  should also have dataset name Sum(Iif(Fields!PointID.Value = 500, 1, 0),"datasetname") 
    Gaur

  • Linking projects/daisy chaining and reporting to an LMS

    Can anyone help please?
    I am new to Captivate and LMS's and so far, have self-taught and read books and lots and lots of web pages for help and information - information overload!
    My problem is this:
    I have a large project (146 slides) which, having read advice, I have tested by breaking into smaller projects. I have Module 1 which is the learning phase for the user, some questions included, but these do not need to report to the LMS. I then have the Test module in a second Cp project - a selection of 20 questions which are pulled from a question pool. These DO need to report to the LMS.
    At the end of Module one, users can opt to either take the test now or later. The user has an option to exit the module and take the test later (close the project - expecting them to be redirected back to this page by the LMS when they open the project again!) or click a button which will open up the Test module. The button to open the Test module has been set to link to the Test Cp project.
    I've tested this so far by publishing both as EXE files and running through the whole module - it all links in fine and I move from one Cp project to another without issue. However, now I am scratching my head about how to publish as Flash files in order for the reporting to work, particularly as there are 2 Cp projects.
    I have looked at the Aggregator function but don't think this is the right route because it automatically adds a TOC and I don't want one (unless someone can tell me how to switch this off in Aggregator..?!)
    I have also looked at using the SCORM Packager, which seems to be the route people are indicating for muliple SCO's published to an LMS.
    Here's what I have done.
    Enabled Quiz Reporting for both projects and set up preferences accordingly.
    Published Module 1 as a zipped SWF (all files - Manifest.XML etc created ok)
    Published Test as zipped SWF - ditto above.
    Run the SCORM Packager and added the 2 zipped files above to create one zipped file.
    Rightly or wrongly, I have unzipped the 'new' combined project, located the HTM file for the first module and run it in Internet Explorer. Whilst this runs ok, on coming to the last screen to link to the Test, it falls over saying it can't find the file. It is looking for the HTM file in the directory where the original .Cp project is stored. There is no HTM file created here - just the original Cp file.
    What am I doing wrong? How do I get them to link correctly AND be able to package them up?
    I can't test this on an LMS as I don't have access to one or to the client's LMS - I will simply be providing them with the zipped file which they will FTP to their LMS.
    Any help would be appreciated as deadline is looming!
    Thanks in anticipation.

    Raquel, have you tried the Reload Editor for setting up the manifest? Also, you may want to give ADL's Test Suite a shot for self-testing your package in an LMS-like RunTime Environment.
    Now, it could be that I'm reading this wrong but it sounds to me like, when you say "There is no HTM file created here - just the original Cp file", there should be an html file there. If your button in the first module is scripted to launch a new html file in the same window, make sure you published the second module to include an HTM file. I'm assuming you mean "swf file" when you mentione "Cp file", right?
    Reload also offers the SCORM 1.2 Player for testing your course in a RunTime Environment.
    Feel free to reach out if you still have issues or need assistance in testing.

  • How to run SQL and export results to Excel

    My task is to run a custom SQL script and create Excel file via running SQL Developer from command line (invoked by a scheduled script). Is this possible using SQL Developer?
    The thing I'm trying first is to run a user-defined report in SQL Developer and save the results to an Excel file. Only 16000 result rows, but took 10 minutes to do the export and still cannot finish. Is there another way to do it?
    Many thanks.

    Thanks K for the update.
    I have done csv files before using pl/sql, no problem at all. It's just that in current work environment, we're using a 3rd party tool to make the Excels and I was asked to study the feasibility of using SQL Developer instead of our current commercial tool to do the job.

  • Report not run inexplorer and report server not start

    sir
    i install dev suit 10g and
    1. create new form and test that run in explorer
    2. create report and test in report builder that run and give right result, but when i test in explorer that not run and no error and report server OC4J not start i try but window appear and hide
    please give me idea how run report in explorer
    regard
    fahim

    The normal procedure for the Developer Suite is:
    1. Start OC4J instance via Windows Start menu.
    2. Run a report:
    http://127.0.0.1:8889/reports/rwservlet?module=....
    That doesn't work?
    Can you see the in-process report server?
    http://127.0.0.1:8889/reports/rwservlet/showenv?
    Or errors in the job queue?
    http://127.0.0.1:8889/reports/rwservlet/showjobs?
    (note that your port number may be different)

  • Run forms and reports  6i on web

    hi every body
    please tell me how i run my existing forms and reports 6i run on web any tutorial or support
    thanks and regards
    ALLAH HAFIZ

    You need to have oracle Application server installed for this. Then configure you apps server and port thr forms and reports in the directory created.
    You can make use of Ora9iAs
    Cheers..... Bob

  • [ANN] Run Forms and Reports on the Web for $5,000

    A new time limited price promotion for customers looking to upgrade Oracle Forms to the Web is now offered.
    Get a restricted license to use Oracle9iAS Forms Services and Oracle9iAS Reports Services only for $5,000 per CPU (or $100 per named user).
    Or you can get 25% discount on the full Oracle9iAS Enterprise Edition.
    Interested?
    visit http://www.oracle.com/tools/deals for more details.

    the first step to give only 9i form server and report server(or services, a buzz word) only is good. But the key issue to adopt the limited 9iAS is whether it must use Oracle LDAP SSO server, if so, then it will have trouble to buy it as it will force to buy full 9ias again.
    E.G., the Chrysler corporate standard is to Websphere, then it prohibits our team to buy another set of similar app. server. Now we like the limited form/report server edition, but before we go ahead to apply for permission to buy, we must also answer if it will work with no Oracle LDAP SSO etc.
    Will the 9.0.4 limited edition work with non-oracle LDAP/SSO ? Or generally, will 9.0.4 be open enough to work with other application server/infrastructure?

  • Running Scheduled Crystal Reports for Multiple Customers!

    Hi,
    We are trying to accomplish what we felt was a very common practice with reports.
    We have CR 2011, CR 2011 Enterprise, CR Server 2011.
    What we are trying to accomplish is very simple.
    Currently, I have a prompt in my report that prompts me with a dynamic list based on a small sql statement my report, it provides a list of individual customer and their id's. It takes that ID , puts it into another SQL statement in the command and generates just that customers data. it works perfectly!
    What we are trying to do is use crystal server 2011 to take that report in question, schedule it, and have it run for each of the dynamic customer id's that I previously used when it prompted the screen.
    The reports cannot use multiple values as we only want each customer data to be included in the report.
    We need to have the scheduler run this report for our 10 different customer idu2019s and send it to their individual email addresses at a scheduled time each day.
    Is this possible? This has to be a very common request of reporting tools.
    If SAP software cannot do it, is there a 3rd party software that will allow our reports to be ran in the way I am wanting?

    Hi Rsheppick,
    Within CR Server you can use the publication functionality to create a publication and schedule this to external customers - for this you would have to use a dynanic recipient list to map the customers email id's to a field in the source report.
    The workflow is described in the online Publication document, accessible at the SAP Support site.
    I hope this is a very helpful answer to you.
    Kind regards,
    John

  • SQL Query - Report on multiple table

    Hi Experts
    Firstly, I am an amateur at generating SQL Queries!
    I am trying to create a Report of All Invoices/Credit Notes generated in a date range combined with all open Sales Orders.
    This is my attempt - I am getting all Sales Orders but only want to have Open Sales Orders.
    SELECT T0.[DocNum], T0.[DocType], T0.[cardcode] AS 'Cust. ID', T0.[cardName] AS 'Customer', T0.[TransId], T0.[TaxDate] AS 'Date', T1.[SlpName] AS 'AC Mgr', (T0.[DocTotal] -T0.[VatSum]) AS'NETT', T0.[DocStatus],T0.[U_BusCategory] AS 'Business Cat.', T0.[U_TERM] AS 'TERM', T2.OpprId, T2.Name
    FROM [dbo].[OINV]  T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode 
    LEFT OUTER JOIN OOPR T2 ON T0.U_RTNo = T2.DocNum
    WHERE CONVERT(nchar(8), T0.DocDate, 112) >= '[%0]'  AND CONVERT(nchar(8), T0.DocDate, 112) <= '[%1]'
    UNION
    SELECT T0.[DocNum], T0.[DocType], T0.[cardcode], T0.[cardName], T0.[TransId], T0.[TaxDate] AS 'Date', T1.[SlpName] AS 'AC Mgr', -(T0.[DocTotal] -T0.[VatSum]) AS'NETT', T0.[DocStatus],T0.[U_BusCategory],T0.[U_TERM] AS 'TERM', T2.OpprId AS 'Oppr. ID.', T2.Name AS 'Oppr. Name'
    FROM [dbo].[ORIN]  T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
    LEFT OUTER JOIN OOPR T2 ON T0.U_RTNo = T2.DocNum
    WHERE CONVERT(nchar(8), T0.DocDate, 112) >= '[%0]'  AND CONVERT(nchar(8), T0.DocDate, 112) <= '[%1]'
    UNION
    SELECT T0.[DocNum], T0.[DocType], T0.[CardCode], T0.[CardName], T0.[TransId], T0.[TaxDate], T1.[SlpName], (T0.[DocTotal]-T0.[VatSum]), T0.[DocStatus], T0.[U_BusCategory], T0.[U_TERM], T2.OpprId AS 'Oppr. ID.', T2.Name AS 'Oppr. Name'
    FROM ORDR T0  INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
    LEFT OUTER JOIN OOPR T2 ON T0.U_RTNo = T2.DocNum
    WHERE CONVERT(nchar(8), T0.DocDate, 112) >= '[%0]'  AND CONVERT(nchar(8), T0.DocDate, 112) <= '[%1]' 
    Any help would be much appreciated
    Derek

    Dear Mr Vard,
    The field in the ORDR table that will tell you if the document is closed or open is the DocStatus.
    C = Closed and O = Open
    You could add another where clause:
    where t0.DocStatus = 'c'
    to the last query you added (the one referring to the ORDR table).
    Please, let me know if this helps you.
    Marcella Rivi
    SAP Business One Forums Team

Maybe you are looking for