Results 1 to 6 of 6
  1. #1
    phd42122 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    4

    Data Sorting Issue

    Hi All,
    I'm doing a project to show different ranges of VIN Numbers with the goal of showing each Model's specific VIN Range. Unfortunately, some MFGs skip around with their VINs as seen in the table below:

    MFG Model VIN
    Honda Accord 1
    Honda Accord 2
    Honda Accord 3
    Honda Accord 6
    Honda Accord 7
    Honda Accord 8
    Honda Accord 9
    Honda Accord 10
    Honda Accord 11
    Toyota Camry a1
    Toyota Camry a2
    Toyota Camry a3
    Toyota Camry b1
    Toyota Camry b2
    Toyota Camry b3
    Toyota Camry b4
    Toyota Camry b5


    The ultimate goal is to produce something that looks like this:
    MFG Model Min Max
    Honda Accord 1 3
    Honda Accord 6 11
    Toyota Camry a1 a3
    Toyota Camry b1 b5

    Min and Max functions don't recognize values that skip, so I'm at a loss for how to approach this from a database perspective

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I presume those aren't real VINs.

    Don't understand why you want that output. The min and max for Honda Accord are 1 and 11, why are the gaps relevant? Why are Honda Accord 1 through 3 differentiated from Honda Accord 6 through 11?

    What you want will probably require VBA code.
    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.

  3. #3
    phd42122 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    4
    They gap is relevant because I've found that certain manufacturers will skip a VIN # in one year and then include it the following year. So Honda might use 4-5 the following year.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Okay, so they use 4-5 next year, 1 and 11 are still min and max. Still don't understand what you are trying accomplish with this output. Do you just want to identify gaps in sequence?
    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
    phd42122 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    4
    I guess Min/Max is misleading--I want to be able to output an accurate list of serial numbers for a given MFG/Model/Year

    Something like this:

    MFG Model Year VIN
    Honda Accord 2011 4-6
    Honda Accord 2011 11-13
    Honda Accord 2012 1-3
    Honda Accord 2012 7-10

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Always helps to provide critical information. Having Year attribute makes a big difference.

    Options:

    1. Totals query with GROUP BY on MFG and Model and Year fields with Min and Max aggregate calc fields

    2. DMin and DMax calculations using WHERE CONDITION argument

    3. Build a report using Grouping and Sorting features
    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.

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

Similar Threads

  1. Report Sorting Issue
    By cbgroves in forum Reports
    Replies: 14
    Last Post: 12-01-2011, 08:44 AM
  2. Replies: 7
    Last Post: 07-10-2011, 06:55 PM
  3. Sorting Data in a Combo Box
    By Mutant_Mike in forum Access
    Replies: 1
    Last Post: 05-03-2011, 03:59 PM
  4. Filtering/sorting data
    By jemelton in forum Access
    Replies: 5
    Last Post: 06-09-2010, 01:47 PM
  5. Sorting data in ADO Recordset
    By martinjamesward in forum Programming
    Replies: 1
    Last Post: 08-28-2009, 05:38 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