Access Parameter Query by form, returns a form for each returned value

I have a form set up with a parameter query. It returns data from multiple tables. My problem is it returns the data for say 7 records, but then it repeats the entire form 7 times, the forms are identical with all the data included. I want it to return
the data on one form. It must be a setting, or statement that is lacking but I can't seem to find it.

Hans,
Thank You for the response. I first changed the setting in the SubForm Query, same result. Then I changed it in the Report, still no difference. After reading some information in other forums it may be because I am pulling the data from the Tables using
the InvoiceNum field from one table, on both the Report and the SubForm, and I have the Report and Subform linked by this field. The InvoiceNum field is the Foreign key created to pull the desired data, if I don't use it I get all the data in the tables, not
just the data I need.

Similar Messages

  • Access Parameter Query

    Does anyone know how to call an Access parameter query with a
    Dreamweaver
    recordset (ASP/VBScript)?
    For instance, if I have an Access query like the one below.
    PARAMETERS varUser Text ( 255 );
    SELECT Users.FirstName, Users.LastName, Users.Login
    FROM Users
    WHERE (((Users.Login)=[varUser]));
    Above is just an example. I know I could easily place the
    where clause in
    the SQL for the recordset on the page if that was all I
    wanted. I need to
    use an Access parameter query though.

    Hans,
    Thank You for the response. I first changed the setting in the SubForm Query, same result. Then I changed it in the Report, still no difference. After reading some information in other forums it may be because I am pulling the data from the Tables using
    the InvoiceNum field from one table, on both the Report and the SubForm, and I have the Report and Subform linked by this field. The InvoiceNum field is the Foreign key created to pull the desired data, if I don't use it I get all the data in the tables, not
    just the data I need.

  • SQL Challenge - Returning count=0 for non-existing values

    Hello there,
    I have a question about our requirement and an SQL query. I have posted this to some email groups but got no answer yet.
    Here is the test case:
    SQL> conn ...
    Connected.
    -- create the pattern table and populate
    SQL> create table pattern(id number, keydescription varchar2(50));
    Table created.
    SQL> insert into pattern values(1,'hata1');
    1 row created.
    SQL> insert into pattern values(2,'hata2');
    1 row created.
    SQL> insert into pattern values(3,'hata3');
    1 row created.
    SQL> insert into pattern values(4,'hata4');
    1 row created.
    SQL> insert into pattern values(5,'hata5');
    1 row created.
    SQL> select * from pattern;
    ID KEYDESCRIPTION
    1 hata1
    2 hata2
    3 hata3
    4 hata4
    5 hata5
    SQL> commit;
    Commit complete.
    -- create the messagetrack and populate
    SQL> create table messagetrack(pattern_id number, realdate date);
    Table created.
    SQL> insert into messagetrack values(1,to_date('26/08/2007 13:00:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(1,to_date('26/08/2007 13:05:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(2,to_date('26/08/2007 13:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(3,to_date('26/08/2007 14:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(4,to_date('26/08/2007 15:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(1,to_date('26/08/2007 15:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from messagetrack;
    PATTERN_ID REALDATE
    1 26-AUG-07
    1 26-AUG-07
    2 26-AUG-07
    3 26-AUG-07
    4 26-AUG-07
    1 26-AUG-07
    6 rows selected.
    Now, we have this simple query:
    SQL> select p.KeyDescription as rptBase , to_char( mt.realdate,'dd') as P1 , to_char(mt.realdate,'HH24') as P2, count(*) as countX
    2 from messageTrack mt, Pattern p
    3 Where mt.realDate >= to_date('26/08/2007 13:00:00','dd/MM/yyyy hh24:MI:ss')
    4 and mt.realDate <= to_date('27/08/2007 20:00:00','dd/MM/yyyy hh24:MI:ss')
    5 and mt.pattern_id=p.id
    6 group by p.KeyDescription, to_char(mt.realdate,'dd'), to_char( mt.realdate,'HH24')
    7 order by p.KeyDescription, to_char(mt.realdate,'dd'), to_char(mt.realdate,'HH24');
    RPTBASE P1 P2 COUNTX
    hata1 26 13 2
    hata1 26 15 1
    hata2 26 13 1
    hata3 26 14 1
    hata4 26 15 1
    But the result we need should contain the pattern values(hata1, hata2, hata3 and hata4) for each time interval(hour) although there are might be no records of some patterns for some hours.
    The result for our test case should look like this:
    RPTBASE P1 P2 COUNTX
    hata1 26 13 2
    hata1 26 14 0
    hata1 26 15 0
    hata2 26 13 1
    hata2 26 14 0
    hata2 26 15 0
    hata3 26 13 0
    hata3 26 14 1
    hata3 26 15 0
    hata4 26 13 0
    hata4 26 14 0
    hata4 26 15 1
    Our version is 10.2.0.2
    On my discussions some said model clause may be used, but i don't know model clause much and can't imagine how to use.
    You can download the test case code above to reproduce from:
    http://www.bhatipoglu.com/files/query1.txt
    You can see the output above more clearly(monospace font) on:
    http://www.bhatipoglu.com/files/query1_output.txt
    Additionally, I want to state that, in the resulting table, we don't want all the patterns(hata1, hata2, hata3, hata4 and hata5). We just want the ones that exists on messageTrack table(hata1, hata2, hata3 and hata4) as you see on the result.
    Thanks in advance.

    Here is an attempt with the Model Clause:
    Edit: I should mention that I created a view out of your original query.
    SELECT rptbase
          ,day
          ,hour
          ,countx
    FROM demoV
      MODEL
        DIMENSION BY (rptbase, day, hour)
        MEASURES (countx)
          RULES(countx[
                        FOR rptbase IN (SELECT rptbase
                                        FROM demoV)
                        ,FOR day IN   (SELECT day
                                        FROM demoV)
                        ,FOR hour FROM 13 to 15 INCREMENT 1
                        ] =
                        NVL(countx[CV(rptbase),CV(day),CV(hour)],0)
                order by 1,2,3;Which produces the following
    RPTBASE                                    DAY                 HOUR               COUNTX                
    hata1                                              26                     13                     2                     
    hata1                                              26                     14                     0                     
    hata1                                              26                     15                     1                     
    hata2                                              26                     13                     1                     
    hata2                                              26                     14                     0                     
    hata2                                              26                     15                     0                     
    hata3                                              26                     13                     0                     
    hata3                                              26                     14                     1                     
    hata3                                              26                     15                     0                     
    hata4                                              26                     13                     0                     
    hata4                                              26                     14                     0                     
    hata4                                              26                     15                     1               Note my Hata1 26 15 has a countx of 1 (I believe that this is correct and that your sample result is incorrect, if this is not the case, please explain why it should be 0)
    Message was edited by:
    JS1

  • Returning concatenated string for each acctid

    Hi All,
    For each acct id, bank statement can be sent to multiple CC EMAIL addresses.
    So, for each acct - only one row should appear. I would need to string together cc email addreses for each acct.
    Can someone provide code for a function that takes acct_id and loops through all the CC email addresses and for each ACCT_ID passed and returns a concatenated result of
    email addresses like "email1, email 2".
    GIVEN TABLE:
    ACCT EMAIL ADDRESS:
    ACCT1 [email protected]
    ACCT1 [email protected]
    RESULT in report:
    ACCT1 [email protected], [email protected]
    Need to do it asap.
    Regards,

    Version? If you are on 11.2 use LISTAGG:
    select  acct,
            listagg(email_address,', ') within group(order by email_address) email_address_list
      from  ypour_table
      group by acct
    /For example:
    with sample_table as (
                          select 'ACCT1' ACCT,'[email protected]' EMAIL_ADDRESS from dual union all
                          select 'ACCT1','[email protected]' from dual
    select  acct,
            listagg(email_address,', ') within group(order by email_address) email_address_list
      from  sample_table
      group by acct
    ACCT  EMAIL_ADDRESS_LIST
    ACCT1 [email protected], [email protected]
    SQL> On lower versions:
    select  acct,
            rtrim(xmlagg(xmlelement(e,email_address,', ').extract('//text()') order by email_address),', ') email_address_list
      from  your_table
      group by acct
    /For example:
    with sample_table as (
                          select 'ACCT1' ACCT,'[email protected]' EMAIL_ADDRESS from dual union all
                          select 'ACCT1','[email protected]' from dual
    select  acct,
            rtrim(xmlagg(xmlelement(e,email_address,', ').extract('//text()') order by email_address),', ') email_address_list
      from  sample_table
      group by acct
    ACCT  EMAIL_ADDRESS_LIST
    ACCT1 [email protected], [email protected]
    SQL>SY.

  • How to display multiple records in smart forms in new page for each record

    Hi,
              How to display the data from a internal table in a smart form.
    I want each record to be displayed in seperate page.
    please tell me with example.
    thank u,
    Sarath

    Do this ,
       in the main window - open a loop on your internal table ,
    within the loop open the text and give the output fields,
    after this text  use the Command node and in this set the next page as page1,
    so when the loop gets executed its first record will be on the first page and the second record will be on the next page and so on ..
    Reward to usefull answers.

  • SQL query to find out last login for each database

    Hi everybody,
    I have a view with following columns:
    DatabaseSid, lastLogin, firstLogin.
    I want to now the newest last_login date for every database.
    SID First Login Last Login
    e.g. Database1, 11.11.2011, 01.12.2011
    Database1, 01.04.2012, 01.05.2012
    Database3, 03.03.2004, 03.06.2005
    Database 3 07.09.2012, 12.10.2012
    How can I do a query to find out for eacht DB (DB1, DB2 and so on) the Last_Login Date?
    Thank you in advance
    Steve

    Steve wrote:
    Hi everybody,
    I have a view with following columns:
    DatabaseSid, lastLogin, firstLogin.
    I want to now the newest last_login date for every database.
    SID First Login Last Login
    e.g. Database1, 11.11.2011, 01.12.2011
    Database1, 01.04.2012, 01.05.2012
    Database3, 03.03.2004, 03.06.2005
    Database 3 07.09.2012, 12.10.2012
    How can I do a query to find out for eacht DB (DB1, DB2 and so on) the Last_Login Date?
    Thank you in advance
    SteveI'm curious as to how you collect this information from multiple databases into one database, and of what value the data is once you have it.

  • Query to find all workbooks/worksheets for each business area

    Hi Experts,
    I need to find all workbooks/worksheets in each business area. Collect 'Query Statistics is checked for all the users'
    Also are there any documents or information available of the description of the discoverer metadata database tables which will help in writing queries
    thanks and regards,
    John

    There is no workbook/worksheet linkage to a business area. So you cannot search for a business area and find all the workbooks "attached" to that business area. The attachment of workbooks is at the folder level. It is actually possible, if you are sharing folders among business areas, to create a workbook with data from 2 or more business areas. I have tested that and it is indeed possible. In Discoverer Administrator you can check on folder dependencies to see what workbooks use the folder. Though in my version of Discoverer, there is a problem with Discoverer Plus, such that the workbook save in Plus is not creating this dependency information like it should. At least I have not found any way to take a business area and determine what workbooks would fall under it. Maybe someone else has found a way.
    John Dickey

  • Query to grouping on task priority for each employee

    Hi All,
    We have following table structure for employee, task & taskallocation.
    CREATE TABLE EMP
       (     "EMP_ID" NUMBER(10,0) NOT NULL ENABLE,
              "FNAME"     NVARCHAR2(50) NOT NULL ENABLE,
              "LNAME"     NVARCHAR2(50) NOT NULL ENABLE
    CREATE TABLE TASKS
       (     "TASK_ID" NUMBER(10,0) NOT NULL ENABLE,
              "TASK_PRIORITY" NVARCHAR2(10) NOT NULL ENABLE          
    CREATE TABLE TASKSALLOCATION
       (     "TASKALLOCATION_ID" NUMBER(10,0) NOT NULL ENABLE,
              "EMP_ID" NUMBER(10,0) NOT NULL ENABLE,
              "TASK_ID" NUMBER(10,0) NOT NULL ENABLE
       The data for the same will be as follows
    Insert into EMP (EMP_ID,FNAME,LNAME) values (1,'XYZ','DFD');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (2,'DFDS','FD');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (3,'FDSF','GFH');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (6,'GFHGF','GFHS');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (4,'GFD','FDG');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (5,'DSFDS','FDSAF');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (7,'GHGY','EWE');
    Insert into EMP (EMP_ID,FNAME,LNAME) values (8,'FGRFSAD','SADF');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (1,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (2,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (3,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (4,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (5,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (6,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (7,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (8,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (9,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (10,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (11,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (12,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (13,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (14,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (15,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (16,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (17,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (18,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (19,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (20,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (21,'LOW');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (22,'HIGH');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (23,'MEDIUM');
    Insert into TASKS (TASK_ID,TASK_PRIORITY) values (24,'LOW');
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (1,1,1);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (2,2,1);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (3,3,2);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (4,3,3);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (5,4,4);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (6,4,5);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (7,4,6);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (8,4,7);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (9,5,6);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (10,6,8);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (11,7,9);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (12,8,8);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (13,8,10);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (14,8,11);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (15,8,12);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (16,6,13);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (17,5,14);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (18,3,12);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (19,3,13);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (20,2,15);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (21,1,16);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (22,2,17);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (23,1,18);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (24,4,19);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (25,6,20);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (26,5,21);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (27,1,22);
    Insert into TASKSALLOCATION (TASKALLOCATION_ID,EMP_ID,TASK_ID) values (28,3,23);
    COMMIT;And we are looking count of tasks based grouping on it's priority per employee. Something like this,
    Resultset
    with
        t as
              select     'XYZ DFD' as EMP_NAME,     3 as HIGH ,     0 as MEDIUM,     1 as LOW FROM dual union all
              select     'DFDS FD'     ,     1     ,     1     ,     1     FROM dual union all
              select     'FDSF GFH'     ,     1     ,     2     ,     2     FROM dual union all
              select     'GFHGF GFHS'     ,     3     ,     1     ,     1     FROM dual union all
              select     'GFD FDG'     ,     0     ,     1     ,     2     FROM dual union all
              select     'DSFDS FDSAF'     ,     1     ,     2     ,     0     FROM dual union all
              select     'GHGY EWE'     ,     0     ,     0     ,     1     FROM dual union all
              select     'FGRFSAD SADF'     ,     1     ,     2     ,     1     FROM dual)Note : We are using Oracle 11.2.0.2.0 version

    Hi,
    select emp.fname || ' ' || emp.lname EMP_NAME
         , sum(case when tasks.TASK_PRIORITY = 'HIGH' then 1 else 0 end) HIGH
         , sum(case when tasks.TASK_PRIORITY = 'MEDIUM' then 1 else 0 end) MEDIUM
         , sum(case when tasks.TASK_PRIORITY = 'LOW' then 1 else 0 end) LOW
      from emp
      join TASKSALLOCATION
        on emp.EMP_ID = TASKSALLOCATION.EMP_ID
      join TASKS
        on TASKSALLOCATION.TASK_ID = tasks.TASK_ID
    group by emp.fname || ' ' || emp.lname
    EMP_NAME                   HIGH     MEDIUM        LOW
    FGRFSAD SADF                  1          2          1
    XYZ DFD                       3          0          1
    GHGY EWE                      0          0          1
    GFHGF GFHS                    1          2          0
    GFD FDG                       3          1          1
    DFDS FD                       1          1          1
    FDSF GFH                      1          2          2
    DSFDS FDSAF                   0          1          2Regards
    Martin Preiss

  • Query to retrieve latest five transactions for each account

    hi,
    I have a table containing transactions of all account holders (this table contains thousands of records). My requirement is to retrieve recent five transactions from the table for all the account holders. Can anyone help me to retrieve the required data.
    Note: Each account holder may have more than one account e.g. savings account, current account etc.
    Regards,
    N Madhavan

    Hi,
    try something like
    select * from (select row_number() over (partition by holders order by transaction_date desc) r, t.* from t) where r<6;
    HTH
    Laurent Schneider
    OCM DBA

  • Need customized query on updateable report (tabular form)

    I have a pl/sql function that returns a SELECT statement based on very flexible query specifications allowed in a form. (Form has a field for each table column, allows operations like <,>,between, etc, that can be entered directly into the field; all fields need not have some sort of query constraint specified. Essentially the same sort of query flexibility you get in Forms... ) The select always returns the same number of columns. Query results are returned on a different page (either report or tabular form) than that used to enter the query specs.
    The function works beautifully on a page type of Report.
    However, when I take a Tabular Form and switch its query source to PL/SQL function body returns SQL select, the page type becomes Report. The query works on this modified page (returns correct rows), and the columns are still editable (can be typed into) but the changes can't be submitted because the page is no longer a tabular form -- Error is: No updateable report found. Multi row updated and delete operations can only be performed on tabular forms of type 'Updateable Report'.
    How can I have flexible query specs paired w/ an updateable report? Does this require writing my own multi-row DML processes? Or is there a simpler way?
    Thanks,
    Carol

    I have a pl/sql function that returns a SELECT statement based on very flexible query specifications allowed in a form. (Form has a field for each table column, allows operations like <,>,between, etc, that can be entered directly into the field; all fields need not have some sort of query constraint specified. Essentially the same sort of query flexibility you get in Forms... ) The select always returns the same number of columns. Query results are returned on a different page (either report or tabular form) than that used to enter the query specs.
    The function works beautifully on a page type of Report.
    However, when I take a Tabular Form and switch its query source to PL/SQL function body returns SQL select, the page type becomes Report. The query works on this modified page (returns correct rows), and the columns are still editable (can be typed into) but the changes can't be submitted because the page is no longer a tabular form -- Error is: No updateable report found. Multi row updated and delete operations can only be performed on tabular forms of type 'Updateable Report'.
    How can I have flexible query specs paired w/ an updateable report? Does this require writing my own multi-row DML processes? Or is there a simpler way?
    Thanks,
    Carol

  • Is it possible to create one home page with links to multiple forms in Adobe Forms Central?

    I have several forms that are all related. Is it possible to have one online landing page where I can link to my other forms from?
    It would be easier to share one link than multiple.

    You could create either a web page of your own to include the links into, or you could create a form that you include the links in - maybe add them as single checkbox fields where the user could check the box stating that they have filled out the related form.  There is a "Insert or edit Link" button in the top toolbar when designing a form, select text you would like to represent the link and click the link button to add the URL to a form.
    The responses for each form would be connected to those individual forms and would not be presented together.  When you recieve responses from the various forms you would not have any built in way to connect the same user to the variuos forms but you could include a "Required" email field in all forms so that you can see who submitted which forms that way.
    Thanks,
    Josh

  • Query for aggregates for each date in a date range

    Hi,
    I want to generate a Trend report with a T-SQL proc, which needs following logic. 
    Input -
    Date Range say '10/10/12' to '20/10/12'  (Say to check the trend of Size of account in 20 days of Trend report)
    Account balance is captured randomly, (i mean not every day) 
    Table with date looks like this..
    --Account Balance Table
    CREATE TABLE AccBanalce (
    BranchId SMALLINT
    NOT NULL,
    AccId CHAR(9)
    NOT NULL,
    Amount DECIMAL(9,3)
    NOT NULL,
    SnapShotDate DATETIME
    NOT NULL 
    CONSTRAINT PK_AccBanalce PRIMARY KEY NONCLUSTERED (AccId, SnapShotDate) )
    GO
    Create CLUSTERED INDEX CIx_AccBanalce ON AccBanalce (SnapShotDate)
    GO
    --Date Range table
    CREATE TABLE DateRange ( StartDate DATETIME, EndDate DATETIME)
    GO
    --Date for the Account Balance Table
    INSERT INTO AccBanalce (BranchId, AccId, Amount, SnapShotDate)
    VALUES (1, 'C1-100',  10.4, '10/11/2010' ),
    (1, 'G1-110',  20.5, '10/11/2010' ),
    (2, 'GC-120',  23.7, '10/11/2010' ),
    (2, 'Gk-130',  78.9, '10/13/2010' ),
    (3, 'GH-150',  23.5, '10/14/2010'),
    (1, 'C1-100',  31.8, '10/16/2010' ),
    (1, 'G1-110',  54.8, '10/16/2010' ),
    (2, 'GC-120',  99.0, '10/16/2010' ),
    (3, 'Gk-130',  110.0, '10/16/2010' ),
    (3, 'G5-140',  102.8, '10/16/2010' ),
    (2, 'GC-120',  105,  '10/18/2010' ),
    (2, 'Gk-130',  56.7, '10/18/2010' ),
    (1, 'C1-100',  84.3, '10/18/2010' ),
    (1, 'G1-110',  75.2, '10/19/2010' ),
    (2, 'GC-120',  64.9, '10/20/2010' ),
    (3, 'GH-150',  84.0, '10/20/2010' ),
    (1, 'C1-100',  78.0, '10/20/2010' ),
    (1, 'G1-110',  89.5, '10/20/2010' )
    GO
    --Date for DateRange Table
    INSERT INTO DateRange (StartDate, EndDate) VALUES
    ('2010-10-11 00:00:00.000', '2010-10-11 23:59:59.997'),
    ('2010-10-12 00:00:00.000', '2010-10-12 23:59:59.997'),
    ('2010-10-13 00:00:00.000', '2010-10-13 23:59:59.997'),
    ('2010-10-14 00:00:00.000', '2010-10-14 23:59:59.997'),
    ('2010-10-15 00:00:00.000', '2010-10-15 23:59:59.997'),
    ('2010-10-16 00:00:00.000', '2010-10-16 23:59:59.997'),
    ('2010-10-17 00:00:00.000', '2010-10-17 23:59:59.997'),
    ('2010-10-18 00:00:00.000', '2010-10-18 23:59:59.997'),
    ('2010-10-19 00:00:00.000', '2010-10-19 23:59:59.997'),
    ('2010-10-20 00:00:00.000', '2010-10-20 23:59:59.997')
    GO
    Question - 
    I want TOTAL Balance of all Accounts in a Branch per each day between 10/11/2010 to 10/20/2010
    If the Snapshotdate (date) on which the account was not made an entery to AccBalance table, last available  balance to be considered for that account.
    like for account [C1-100] on 10/15/2010 the balance should be [10.4]
    --Group By Branch
    --Last valid Account balance to be considered.
    I know, this is long solution, but any one who is expert in T-SQL can help me in this solution.
    Thanks,
    Krishna

    Thanks Himanshu You almost solved my issue...but can you provide the final output as following...
    Actually you are aggregating the Amount, which is not required, as it is the total available in that account.
    But the missing pint is I need the SUM of all the accounts for each DAY in a BRANCH.
    The 3rd Result Query modified to get DAILY balances for each account as following...
    --*RESULT*
    SELECT a.AccId, a.StartDate, 
                        (SELECT TOP 1 b.Amount
                        FROM #InterimOutput b
                        WHERE b.AccId = a.AccId and b.Amount > 0
                        AND B.StartDate<=A.StartDate  ORDER BY B.StartDate DESC) as ToDateBal
    FROM   #InterimOutput a
    ORDER BY a.AccId
    go
    Now I need SUM of all Account Balances AT each BRANCH on DAILY basics. Can you help on that?
    Thanks again
    Krishna

  • Using Broadcaster to run a query for sequential Variable Values

    Hi SDN Community
    I came across a powerpoint slide regarding broadcasting which i hope to use in one of our reports.
    We are on SAP BW 35.
    Broadcaster has been used
    Your opinion would be greatly valued in regards to the direction i should proceed for our particular purpose.
    We basically have a report which is a web report.  This contains much html and javascript enhancements.
    But it essentially has queries with a series of variables.
    The customer would like the Queries to be cached for each variable value for performance reasons, on a daily basis.
    eg. Run the same query for Variable value BMABRM, then BMASRM, etc...
    In a loop fashion.
    Do not need to set a process chain to trigger broadcaster, or rather simply to schedule the broadcaster to run daily.
    I would basically then want to run this (cache) query in an iterative fashion, ie. rerun it for all the sites.
    Can you please make a recommendation to which is the best approach, whether a process chain should be set up, and any experience you may have had setting up a query to rerun for different variable values.  We would of course want the query to run successfully before rerunning it for the next variable to avoid locks, etc.
    Thank you in advance.
    Simon

    Hi Rahul,
    i have been trying to use the process chain functionality to do this but unsure how to do it.
    Which objects do you use in the process chain:
    Trigger Event Data Change (for Broadcaster)
    or Execute APD Model
    or Precalculation of Web Templates
    i am unsure how to incorporate the queries into the process chain.
    If you have any steps , it would be much appreciated.
    Thank you.
    Simon

  • Passing sort as a parameter to Reports from Oracle 9i forms

    I'm trying to call a report from 9i forms by passing 13 parameters. One of them is a 'sort' parameter. All the other parameters are passed succesfully to the report and the report also receives them successfully. But 'sort' parameter didn't work. I don't know if the report received it or not. I can see all the parameter values on the browser link of IE. The sort parameter also appears there but doesn't sort the data.
    !!!!! Please help me out !!!!
    Thank you.

    Hello,
    Are you still haveing problems witht he sort parameter? If so, I use a lexical parameter as the sort parameter along with an after paramter form trigger. I have found that a bind variable doesn't work. So it maybe that the report is running just fine but the sort parameter is just not working properly due to the bind variable. If you don't have it set up with a lexical paramter, try this:
    First get rid of any bind variable with an "ORDER BY" clause. For example, you may have:
    select
    columnA,
    columnB,
    columnC,
    columnB
    from tableA
    where
    columnA is not null
    order by
    :sortby
    However, replace the order by with:
    select
    columnA,
    columnB,
    columnC,
    columnB
    from tableA
    where
    columnA is not null
    &sortby
    Then create another user parameter by clicking the "+" in the object navigater. Call it P_1. Use this parameter as the parameter the users sees. You can create a static list of values that a user can choose to sort by. Say "A", "B","C", and "D".
    Then in your after parameter form trigger, put the following code:
    function AfterPForm return boolean is
    begin
    IF :P_1 = 'A' THEN
    :sortby := 'Order by columnA';
    ELSE IF :P_1 = 'B' THEN
    :sortby := 'Order by columnB';
    ELSE IF :P_1 = 'C' THEN
    :sortby := 'Order by columnC';
    ELSE IF :P_1 = 'D' THEN
         :sortby := 'Order by columnD';
         END IF;
    END IF;
    END IF;
    END IF;
    return (TRUE);
    end;
    Hope this helps.
    Martin

  • Execute Query not working on custom forms

    Hi
    After upgrading from 11.5.10.2 and Oracle 9.2.0.5 to ATG6, AD6, oracle 10.2.0.4, Forms 6.0 (Form Compiler) Version 6.0.8.28.0 . The execute query (F11 & CTRL F11) is not working on custom forms. But after tabbing from one column to another column then press CTRL F11 is working.
    Please any one help me on this issue.
    Thanks
    sva

    Hi
    I found this error in the trace file. Please help me what is the problem, the data is there in the table.
    Out Argument 0 - Type: String Value: ORA-01403: no data found
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: parameter.G_query_find
    Out Argument 0 - Type: String Value: NULL
    Executing USER_EXIT Built-in:
    In Argument 0 - Type: String Value: FND MESSAGE_CLEAR
    MCXQPBULKINVOICEENTER, -1, Built-In, Entry, -1196178744, USER_EXIT
    TSE FSERVER_START -1 1407 1279530838565801000
    TSE FSERVER_END -1 0 1279530838579778000MCXQPBULKINVOICEENTER, -1, Built-In, Exit, -1196091744, USER_EXIT
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Entering app_debug.clear
    In Argument 1 - Type: String Value: global.frd_debug
    Executing FIND_GROUP Built-in:
    In Argument 0 - Type: String Value: APP_DEBUG
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Completed app_debug.free.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing MESSAGE Built-in:
    In Argument 0 - Type: String Value: FRM-41003: This function cannot be performed here.
    In Argument 1 - Type: Number Value: 121
    Unhandled Exception ORA-100501
    State Delta:
    MCXQPBULKINVOICEENTER, -2, Trigger, Exit, -1190876744, ON-ERROR
    ##### CTIME STARTS HERE
    # 8 - MCXQPBULKINVOICEENTER:BLOCKNAME.RADIO_BUTTON81.1279530839956685000
    KEY Execute_query
    Error Message: FRM-41003: This function cannot be performed here.
    N-ERROR Trigger Fired:
    Form: MCXQPBULKINVOICEENTER
    State Delta:
    MCXQPBULKINVOICEENTER, -2, Trigger, Entry, 181183256, ON-ERROR
    MCXQPBULKINVOICEENTER, -1, Prog Unit, Entry, 181304256, /MCXQPBULKINVOICEENTER-3/P58_07_DEC_200909_04_40
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Entering app_standard.event. Event is ON-ERROR.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing ERROR_TYPE Built-in:
    Out Argument 0 - Type: String Value: FRM
    Executing ERROR_CODE Built-in:
    Out Argument 0 - Type: Number Value: 41003
    Executing ERROR_TEXT Built-in:
    Out Argument 0 - Type: String Value: This function cannot be performed here
    Thanks
    sva

Maybe you are looking for