Results 1 to 8 of 8
  1. #1
    Grimjack60 is offline Novice
    Windows 10 Office 365
    Join Date
    May 2024
    Posts
    4

    Calculation Field in a Report

    Hello,


    I have an unbound calculated field in my report [Days from Planned Submission]. It determines the number of days between 'today' and the date in another field of the same record [Planned Submission Date] by using the DateDiff command {=DateDiff("d",Date(),[MaxOfPlanned_Sub_Date])}. This field works fine. However, I am having trouble creating another calculation field at the bottom of the report which will compute the average for all the DateDiff records in this report. Any advice would be appreciated.

    - Grimjack

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Is the "bottom of the report" the report footer? If not, try it there.

  3. #3
    Grimjack60 is offline Novice
    Windows 10 Office 365
    Join Date
    May 2024
    Posts
    4
    Quote Originally Posted by davegri View Post
    Is the "bottom of the report" the report footer? If not, try it there.
    Yes, it is located in the Report Footer section. It is the coding I am having trouble figuring out. The first calculation field was easy. However, creating a second calculation field based on another calculation field is escaping me.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Instead of basing the final calculation on a previous calculated field, just repeat (include) the previous calculation in the final.
    If that doesn't work, please provide more detailed information about the report's construction.

  5. #5
    Grimjack60 is offline Novice
    Windows 10 Office 365
    Join Date
    May 2024
    Posts
    4
    The first field in my report selects most recent Planned Submission Date for a document {MaxOfPlanned_Sub_Date} from a table. The second field calculates the number of days between the day the report is run and the date in the Planned Submission Date field {=DateDiff("d",Date(),[MaxOfPlanned_Sub_Date])}. Now I need to create a field in the Report Footer that will calculate the average of all numbers in the second field.

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Another approach might be to do the datediff calculation in the query that is the recordsource for the report.

  7. #7
    Grimjack60 is offline Novice
    Windows 10 Office 365
    Join Date
    May 2024
    Posts
    4
    That idea worked, Dave. Thank you.

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Quote Originally Posted by Grimjack60 View Post
    That idea worked, Dave. Thank you.
    Been there, done that, and remembered it. Good luck with your project!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating Calculation Field in Report
    By PandoraGirl in forum Reports
    Replies: 7
    Last Post: 05-03-2022, 03:16 PM
  2. Replies: 4
    Last Post: 01-29-2017, 05:24 PM
  3. Tbl1 field * tbl2 field calculation
    By davesexcel in forum Access
    Replies: 5
    Last Post: 07-01-2013, 08:44 AM
  4. Calculation Field in table vs Query calculation
    By Leonidsg in forum Database Design
    Replies: 18
    Last Post: 02-28-2013, 09:38 PM
  5. Conditional calculation in report field
    By gh444 in forum Reports
    Replies: 11
    Last Post: 12-30-2011, 04:41 PM

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