Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528

    Problem in the design report

    Hello all

    Is it possible to work this report?
    I enclosed a picture of the report


    And also annexed the databaseDatabase.zipClick image for larger version. 

Name:	1458951_654776571239202_1607682014_n.jpg 
Views:	36 
Size:	92.5 KB 
ID:	14525

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    You need to post the layouts of the underlying data tables before we can answer the question
    Code:
    MyTable
       MyKey    PK
       MyField1  Text
       MyField2  (FK to table MyOtherTable)

  3. #3
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you for your interest
    Dal Jeanis

    There is a database annex

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Looks like a CROSSTAB query could be relevant and a report using Grouping & Sorting features.

    However, designing a perpetually stable report based on CROSSTAB can be difficult.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you JUNE

    Do we change the tables

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't know your database so hard to address that question about design.

    But offhand, I would say no, do not change tables. CROSSTAB is a query to manipulate data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    I'm confused
    But I found in one of the sites
    This example
    Attached Files Attached Files

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That appears to be doing the opposite of the output shown in your image.

    Post an example of your raw data. If the image is the result you want, we can then advise how to get there.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    I reviewed your main form "Data" and the subforms and suggest the following:

    SUBFORM MOLE

    Either change the title of the GC average calculation on your "Mole" form to "Total", or change your GC average calculation to
    Code:
    =([C2%(Mole)]+[C3%(Mole)]+[C4%(Mole)]+[C5%(Mole)]+[C6%(Mole)])/5
    SUBFORMS FRMSPG AND SUMFRMSPG

    Your frmspg subform at the far right of the "Data" form is showing the same data as the sumfrmspg at the bottom left. The titles look correct on the frmspg, except you need to give a meaningful name, such as "Total", to Expr1 in the query and on the form.

    The sumfrmspg subform looks to have mostly wrong titles, and is redundant data when compared to frmspg.

    REPORT LAYOUT

    I reviewed your requested report, and I can't find any way to relate the data in your sample report layout with the actual fields and values in your test data.

    The RVP in your sample report does not look anything like the values for RVB calculated by your queries.

    The SPGR in your sample report does not look anything like the values for SPGR calculated by your queries.

    There is no data in the database to get 1a for Copper or NEL for Sulphur.

    I can only guess that the headings are intended to be HH/DD where Nov 11th at 08:00 AM is 08/11???

    ODD TABLE

    There is an empty "Time" table (not a good name since it's a reserved word), and I can't see what it is intended to be used for. It appears to be intended to link the Data and Mole tables, although the TimeID in the mole table contains an actual time rather than a foreign key to that Time table.

  10. #10
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    If you can explain what the column headings are supposed to be, then I can probably help you figure out your report.

  11. #11
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much Dal Jeanis
    On those tips
    Can you help me if you can.
    As for the field average
    For example,
    I have a query result-set with several columns: A, B, C ,D. All Four of these
    columns display numbers. From this query, which I will call the "SetUp"query, I want to query it and obtain the average for each of
    the columns A, B , C ,D. However, some of the values in columns A, B , C ,D are zero. If I use
    the standard 'Avg' function in Access, it averages
    the column AND INCLUDES THE ZEROS IN THE AVERAGE. How can I get an average of just all the
    non-zero entries?

    There is also another problem, a report
    There is no problem of making it vertically
    Is it possible example
    Thanks again,

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Nulls are ignored in Sum and Avg functions. Convert the 0 to null with an expression and Avg the constructed field.

    IIf([A]=0, Null, [A])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    So, your desired average calculation could look something like this
    Code:
    =IIF(([A]+[B]+[C]+[D])=0,0,(([A]+[B]+[C]+[D])/(IIF([A]=0,0,1)+IIF([B]=0,0,1)+IIF([C]=0,0,1)+IIF([D]=0,0,1))))
    The explanation for this equation goes like this:
    A) If all four values are zero, then return 0 as the average. This avoids the error where the divisor (bottom number) of the next calculation is zero.
    B) Add up all four values.
    C) Count up the number of values that are not zero.
    D) divide B by C and return that as the average.

    The above code assumes the numbers are all positive, which should be okay for your application. Use this if your values might ever be negative.
    Code:
    =IIF(([A]=0 And [B]=0 And [C]=0 And [D]=0),0,(([A]+[B]+[C]+[D])/(IIF([A]=0,0,1)+IIF([B]=0,0,1)+IIF([C]=0,0,1)+IIF([D]=0,0,1))))

  14. #14
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    azhar - I still don't know what those headings are suppose to be. In your sample, what does 11/11 and 12/11 mean? is that 11 November and 12 November? Are the values in the report supposed to be the averages for the day?

  15. #15
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much Dal
    This report is
    There are checking for gas pumps
    This equipment is checked four times per day, for example,
    c2 checked at 12:00 and at 02:00 and 04:00 and 06:00 on 11/30/2013
    There is a report of one day enclose you a picture of it
    The report is a total of ten days only includes one field which average
    Click image for larger version. 

Name:	fdfdd.jpg 
Views:	31 
Size:	88.2 KB 
ID:	14539

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query Design Problem
    By hardleydirt in forum Queries
    Replies: 5
    Last Post: 11-16-2012, 01:58 PM
  2. design problem
    By masoud_sedighy in forum Database Design
    Replies: 1
    Last Post: 12-15-2011, 11:22 AM
  3. complex design problem
    By Madmax in forum Access
    Replies: 2
    Last Post: 12-09-2011, 08:25 AM
  4. design problem
    By marianne in forum Database Design
    Replies: 7
    Last Post: 05-26-2009, 07:25 PM
  5. Forms design problem
    By GeorgeD in forum Forms
    Replies: 2
    Last Post: 05-08-2008, 12:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums