Results 1 to 8 of 8
  1. #1
    greg2725d is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    3

    Grouping

    So I have a simple database set up for customer service contracts. These contracts need to be reviewed yearly. I need to create a report that shows us all of our past due contracts. However, these reports need to be sorted by:
    1: 0-30 days past due
    2: 30-60 days past due


    3: 60-90 days past due
    4: 90+ days past due

    I was able to calculate the days over due just fine, This just tells me how many days from the current day another day is.
    Code:
    DateDiff("d",[Products]![Initial Date],Now())-365
    But I have no idea on how to group them, the way I need them. Any help would be great. I'm fairly new to the reporting part of access btw.

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    The best way to do this is to create a query in which you have a field that calculates how many days the contract is overdue by - Name it DaysPastDue.

    Then - If you don't already have a Module in your Database - create a new Module.
    You can accept the default name of Module1 if you want.

    In the module - create a Function that:
    Receives the number of days overdue as a parameter and
    Returns a String [Eg: 0-30 Days Past Due, 30-60 Days past Due . . .].
    In your Function - you will look at the Value that is passed in and if the number of days is less than 30 - you will Return "0-30 Days Past Due" . . . etc.
    Name the Function DaysOverdue.

    [Let me know if you need help with this - it's quite easy actually].

    Create another query - using the first query as the data source.
    In the second query - in your DaysPastDue field - make it like this:

    OverdueBy: DaysOverdue([DaysPastDue)
    What this will do is - for each record in your table it will look at the number of DaysPastDue for that record - and it will return you a Value like 0-30 Days Past Due, 30-60 Days past Due . . ..

    Now you can create a Report based on this second Query - and you will be able to group your records in the report on the 'OverdueBy' field in your second query.

    This may sound complicated to you - but if you do it one step at a time - it will work out just fine.

    Let me know if you need help.

  3. #3
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I would do this with a cross tab query based upon the calculation you show. Here is a short tutorial on how to build a cross tab query.

    http://www.datapigtechnologies.com/f.../crosstab.html

    Alan

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Thanks for posting that tutorial, Alan. It was very helpful.

  5. #5
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

  6. #6
    greg2725d is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    3
    I apologize, I was unaware of proper corssposting procedure.

  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Did you get the solution you need?

  8. #8
    greg2725d is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    3
    I'm working on it now. I keep getting pulled away from my desk. Will post when I do though. thanks guys for your help.

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

Similar Threads

  1. Grouping
    By EricF in forum Reports
    Replies: 5
    Last Post: 07-18-2011, 03:58 PM
  2. Form Grouping
    By Desstro in forum Forms
    Replies: 12
    Last Post: 08-09-2010, 04:44 AM
  3. Sorting and Grouping
    By mduplantis in forum Queries
    Replies: 3
    Last Post: 07-29-2010, 12:31 PM
  4. Grouping By Age
    By xnixiel in forum Queries
    Replies: 1
    Last Post: 07-01-2010, 09:14 AM
  5. Grouping
    By dref in forum Reports
    Replies: 1
    Last Post: 01-16-2010, 08:30 AM

Tags for this Thread

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