Results 1 to 6 of 6

Thread: Shape Statement?

  1. #1

    Thread Starter
    Fanatic Member noielen's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Phil.
    Posts
    680

    Arrow Shape Statement?

    I want to view my data report like this:

    --------------------------------------------------------------------------
    DEPARTMENT1
    --------------------------------------------------------------------------
    EXTENSION - CALLER - DURATION - CHARGES
    822 - EMP1 - 00:12:20 - $5.23
    123 - EMP2 - 00:23:12 - $11.25

    Subtotal by Department: Department1 $15.48

    --------------------------------------------------------------------------
    DEPARTMENT2
    --------------------------------------------------------------------------
    EXTENSION - CALLER - DURATION - CHARGES
    111 - EMP13 - 00:12:10 - $1.11
    102 - EMP1 - 00:45:13 - $23.15

    Subtotal by Department: Department2 $24.26

    AND SO ON...

    GRAND TOTAL DISPLAY HERE: ....

    Database Structure:
    Department : Name
    Employee : Name, Department, ...
    Calls : Caller, Duration, Total, ...

    Using Shape statement, i have my code below that gives me wrong output.
    VB Code:
    1. cmdrep.CommandText = " SHAPE {Select NAME from Department} " & _
    2.  " AS DEPT APPEND ({SELECT CALLS.EXTENSION, CALLS.CALLER, " & _
    3. " CALLS.DATE, CALLS.TOTAL, CALLS.DURATION, EMPLOYEE.NAME, " & _
    4. " EMPLOYEE.DEPARTMENT " & _
    5.                      " From CALLS, EMPLOYEE WHERE EMPLOYEE.DEPARTMENT = ? " & _
    6.  " AND CALLS.DATE BETWEEN #" & CDate(Me.txtstart.Text) & "# AND #" & _
    7. " CDate(Me.txtend.Text) & "# " & _
    8.                      " } AS EMPCALLS RELATE NAME TO PARAMETER 0, NAME TO " & _
    9. " DEPARTMENT) AS EMPCALLS "
    This query displays all departments and all employees as callers which is not relate to the department of employee to department.name....

    Any help here really appreciated...
    Last edited by noielen; Apr 27th, 2006 at 06:42 AM.
    noister
    <advertising link removed by moderator>

  2. #2

    Thread Starter
    Fanatic Member noielen's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Phil.
    Posts
    680

    Re: Shape Statement?

    i made it simple, but still won't work:
    i changed the the name, department fields in my employee table to caller, departmentname and the name field in my department table to departmentname:
    VB Code:
    1. cmdrep.CommandText = " SHAPE  {select * from Department} " & _
    2.                      " APPEND ((SHAPE  {select * from employee} " & _
    3.                      " APPEND ({select * from [calls]} AS rscalls " & _
    4.                      " RELATE caller TO caller)) AS rsempcalls " & _
    5.                      " RELATE departmentname TO departmentname) "
    error occured: departmentname does not exist in the appropriate rowset.
    noister
    <advertising link removed by moderator>

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Shape Statement?

    Moved to Reporting section

  4. #4

    Thread Starter
    Fanatic Member noielen's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Phil.
    Posts
    680

    Re: Shape Statement?

    why is it give an error: "Report sections do not match data source"
    VB Code:
    1. cmdrep.CommandText = " SHAPE  {select * from department} AS department " & _
    2.                      " APPEND ((SHAPE {select * from employee} " & _
    3.                      " APPEND ({select * from [calls]} as empcalls " & _
    4.                      " RELATE caller TO caller)) " & _
    5.                      " RELATE departmentname TO departmentname) "
    see attached file as my design view in my data report.
    Last edited by noielen; Jul 16th, 2007 at 11:50 PM.
    noister
    <advertising link removed by moderator>

  5. #5

    Thread Starter
    Fanatic Member noielen's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Phil.
    Posts
    680

    Re: Shape Statement?

    any idea here please?
    noister
    <advertising link removed by moderator>

  6. #6

    Thread Starter
    Fanatic Member noielen's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Phil.
    Posts
    680

    Re: Shape Statement?

    continue here please... drop some ideas here
    noister
    <advertising link removed by moderator>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width