Results 1 to 5 of 5
  1. #1
    pervej.fac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2013
    Posts
    4

    Arrow merit position generation query

    hi,
    take my cordial respect.I am in so much problem with my software.
    I am developing a school management software.In my software i have a table like under table

    RegistrationNo TotalMarks
    101 550
    102 562
    103 550
    104 620
    105 700

    Now I want to generate merit position depending on Registration No.I will input a RegistrationNo in a form textbox query will give merit position of that specific Registration No.Suppose I have inputted RegistrationNo=104 then display merit position 2nd for that RegistrationNo.

    If any one give me a sample access project file then i will be much grateful to you.



    thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Sounds like ranking records. This is not easy. Review http://allenbrowne.com/ranking.html
    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
    pervej.fac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2013
    Posts
    4
    hey
    i have already used this page but i have not got my expected result.Could you please give me a solution with attached file?

  4. #4
    pervej.fac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2013
    Posts
    4

    Thumbs down

    hey brother,
    I have attached my access file.please see.Here merit position column in query is generation merit position.But here merit position 1 has been generated twice but then generated 3 excluding merit position 2.I want 1,1,2 just like merit wise.
    Attached Files Attached Files

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    That query counts how many records beat the value of the current record. I added another record in the posted db (104 & 600). The results are 0, 1, 1, 3 (sorted by TotalValue DESC). Almost there but not quite. Need to assign a ranking by descending TotalValue regardless of CustomerID. Need a dataset that reduces the TotalValue field to distinct values and assigns a sequential rank by descending TotalValue then join that dataset to the qryCustomerValue table linking on the TotalValue field.

    Query1: DistinctValue
    SELECT DISTINCT qryCustomerValue.TotalValue
    FROM qryCustomerValue;

    Query2: ValueRank
    SELECT TotalValue, (SELECT Count([TotalValue])
    FROM DistinctValue AS Dupe
    WHERE Dupe.TotalValue > DistinctValue.TotalValue)+1 AS MeritPos
    FROM DistinctValue;

    Query3:
    SELECT qryCustomerValue.CustomerID, qryCustomerValue.TotalValue, ValueRank.MeritPos
    FROM ValueRank INNER JOIN qryCustomerValue ON ValueRank.TotalValue = qryCustomerValue.TotalValue;
    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. Error on generation of report
    By TOMMY.MYERS668 in forum Reports
    Replies: 1
    Last Post: 03-02-2013, 11:06 AM
  2. Random value generation?
    By Delta223 in forum Access
    Replies: 4
    Last Post: 01-12-2012, 12:14 PM
  3. Report Generation
    By Lorlai in forum Reports
    Replies: 5
    Last Post: 07-01-2011, 11:13 AM
  4. Replies: 5
    Last Post: 09-10-2010, 10:07 AM
  5. Append Query position
    By t_dot in forum Queries
    Replies: 7
    Last Post: 08-11-2010, 11:17 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