User Profile

Collapse

Profile Sidebar

Collapse
Daniel Yantis
Daniel Yantis
Last Activity: Oct 26 '11, 06:06 PM
Joined: Aug 3 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Daniel Yantis
    replied to Identify Ties
    Thank you NeoPa, This works!
    Code:
    SELECT tD.*
    FROM Data AS tD INNER JOIN (SELECT   [Class]
                   , [Score]
            FROM     [Data] AS [Dupe]
            WHERE    (NOT [DSQ])
              AND    ([BestOf]=0)
              AND    ([Score] In (SELECT   TOP 3 [Score]
                                  FROM     [Data]
                                  WHERE    ([Class]=Dupe.Class)
    ...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    I think I did answer your question when I said this seems to work...
    However it was qryMedalDups that was working for me.

    I made it clear in my post #19 what the results were to the other query. (since it was the same query)
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    I actually think this is working as it is.
    However, qrySubMedalDups is not very useful in my needs.

    I noticed that qryMedalDups is nothing like anything we have discussed thus far. But that is what was needed. It seems complicated, but I do see why the inner join was added. I did not understand previously that the returned scores did not return the entire record details. I see now where my limited understanding was messing me...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    As far as sending the file to you, it is in Access 2010 and will not give me the option to save as 2007 or 2003. Apparently my data source has options that are not backward compatible and therefore that option is not available.
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    No, I do not understand the text you are writing to me.
    Remember, I am a noob and i do not know all the technical terms.

    I further do not understand your last part in post 14.
    I do not understand aggregates or even what the word means.

    However, for the sake of attempting to solve my problem...
    I Cut and paste your code above (and after deleting all my fields in the report so the errors of control source...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    I don't know what else to send to you!
    This code:

    Produces this result (which is where I am at now):


    This is the ties in the entire class, not ties in the top 3 scores......
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    I just DON'T understand!!!
    I am ready to quit but I have to get this project done.

    Taking your code from post #2 above, I have to add to line 1 (Select) so that the fields in my report will have control sources...
    But that still does not work!

    This is what error comes up:

    Here is the code for my winner's report:

    And that code shows this report:

    Here is the date type:...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    wow that was cool....
    It found the TOP 3 duplicates under the entire CLASS.
    (My actual data file has about 1200 records)
    I just need the duplicates in the TOP 3 SCORES for each CLASS.

    I wish I knew how to use SQL better, but it just confuses me.

    Here is some code that finds TOP 3 TIES in an old database I had.
    (useless now because I changed so much other stuff and also lost the original data...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    I pasted your code from #2 above (after your edit) and Access reformat's it to this:
    Code:
    SELECT Dupe.[Score]
    FROM Data AS Dupe
    WHERE (((Dupe.[DSQ])=False)
       AND ((Dupe.[BestOf])=0)
       AND ((Dupe.[Score]) In (SELECT   TOP 3 [Score]
                               FROM     [Data]                       
                               WHERE    ([Class]=Dupe.Class)
                                 AND    ([Score]>0)
    ...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    I cut and Pasted you code from #4 above and I get this error on saving:

    ** Edit **
    [imgnothumb]http://bytes.com/attachments/attachment/5336d1313723660/error.jpg[/imgnothumb]...
    See more | Go to post
    Last edited by NeoPa; Aug 19 '11, 06:23 PM. Reason: Made image visible

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    This works:
    Code:
    SELECT Dupe.Class, Dupe.DSQ, Dupe.Score, Dupe.*
    FROM Data AS Dupe
    WHERE (((Dupe.Class)<>"**** - U n k n o w n - NEEDS CLASSIFICATION")
      AND ((Dupe.DSQ)=False)
      AND ((Dupe.BestOf)=0)
      AND ((Dupe.Score)>0
      And (Dupe.Score) In (SELECT TOP 3 Data.Score
                           FROM Data
                           WHERE ((Data.Class=Dupe.Class
    ...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    The code you provided will not run in my version of Access (2010).

    Access changes punctuation when you save. No amount of editing will force it to keep some punctuation changes. Access also changes (NOT(Data.DSQ) into (Data.DSQ=False ) and will not allow me to keep the NOT statement.

    If I cut and paste your code above EXACTLY AS YOU HAVE IT I get a syntax error and can't continue to save it.

    Maybe you could...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to Identify Ties
    If I try to save the following SQL it saves ok.
    Then run it and I get "cannot group on fields selected with '*'(Dupe)"
    Then when I go back into query editor (not SQL view) it is all messed up...
    Code:
    SELECT Dupe.Class, Dupe.DSQ, Dupe.Score, Dupe.*
    FROM Data AS Dupe
    WHERE (((Dupe.Class)<>"**** - U n k n o w n - NEEDS CLASSIFICATION")
      AND ((Dupe.BestOf)=0)
      AND ((Dupe.DSQ)=False)
    ...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to SELECT TOP 3 Within a GROUP BY
    FOR REAL: your help is truly appreciated!
    I think I got this question answered now.
    About a year ago I worked on this same project but lost the whole thing. So I am having to relearn some and remember what I did.

    Thank you for being patient to a noob!

    I have the next question using this SQL in a new topic (Mod Edit - See Identify Ties).
    See more | Go to post
    Last edited by NeoPa; Aug 18 '11, 05:16 PM. Reason: Added link to new thread - Titles must be meaningful - Please remember for future - Also removed 'shout'

    Leave a comment:


  • Daniel Yantis
    started a topic Identify Ties

    Identify Ties

    You guys have been great! Thank you for all your help. I am learning as I go...

    So now that I have a working SQL statement for a winner's list, I need to have a new report that shows ONLY TIE score in the top 3 from the winner's list so that I can quickly see tie problems before giving trophies out.

    Here is the sample data:

    Code:
    [B][U]ID    Class  Score   DSQ   BestOf[/U][/B]
    11    ACCF     81   False    0
     2    ACCF
    ...
    See more | Go to post
    Last edited by NeoPa; Aug 18 '11, 05:25 PM. Reason: Daniel the titles to your questions are vague. "Advanced SQL", "SQL Problems".

  • Daniel Yantis
    replied to SELECT TOP 3 Within a GROUP BY
    If it is filtered out in the subquery, why is it returning the score at all?
    Please remember I am a noob...

    The way I think I understand it is this:
    The subquery returns records to the main query based on the subquery criteria. Therefore, the main query should only have available to it the records that are not disqualified.

    Where am I messed up here? I need to understand A LOT more.
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to SELECT TOP 3 Within a GROUP BY
    hmmm...

    I see you edited your post and said it was in Access 2010. I first read you would look at my attachment. I see the "In the meantime" now. But I don't see where I was asked twice?

    Sorry, but the sarcasm most certainly will not help. It is clear that I am a noob and your assistance is greatly appreciated. Please work on being patient with people.

    Anyway, how to I post the example data?...
    See more | Go to post
    Last edited by NeoPa; Aug 18 '11, 04:45 PM.

    Leave a comment:


  • Daniel Yantis
    replied to SELECT TOP 3 Within a GROUP BY
    BTW, Access changes 0/1 to False/True when you save the SQL...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to SELECT TOP 3 Within a GROUP BY
    It now works like this...

    Code:
    SELECT Dupe.Class, Dupe.DSQ, Dupe.Score, Dupe.*
    FROM Data AS Dupe
    WHERE (((Dupe.Class)<>"**** - U n k n o w n - NEEDS CLASSIFICATION")
       AND ((Dupe.DSQ)=False)
       AND ((Dupe.Score)<>0
       AND  (Dupe.Score) In (SELECT TOP 3 Data.Score
                             FROM Data
                             WHERE (((Data.Class)=(Dupe.Class)
    ...
    See more | Go to post

    Leave a comment:


  • Daniel Yantis
    replied to SELECT TOP 3 Within a GROUP BY
    well, I have discovered that this returns the disqualified record only if it is a tie score with another in the top 3.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...