Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3397994
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:35:45+00:00 2026-05-18T04:35:45+00:00

I have the following SQL SELECT CNumber, MAX(FormSubmitted), Score FROM dbo.vw_MSA WHERE (Score IS

  • 0

I have the following SQL

SELECT     CNumber, MAX(FormSubmitted), Score
FROM         dbo.vw_MSA
WHERE     (Score IS NOT NULL)
GROUP BY CNumber, Score

Results:

CNumber FormSubmitted                   Score
0011509 2010-09-13 10:22:46.763         11
0016239 2010-09-28 13:53:58.557         8*
0016239 2010-10-12 11:52:33.150         12
0018792 2010-11-02 13:17:37.437         3
0051089 2010-10-07 11:38:29.257         13
0051091 2010-10-01 12:01:30.450         0
0067987 2010-09-29 11:06:48.490         7
0079351 2010-09-30 09:49:10.747         34
0833933 2010-09-30 12:54:19.013         6
0848185 2010-10-07 12:08:42.087         6
5010590 2010-11-01 09:54:14.790         6*
5010590 2010-11-16 15:23:50.350         12

I’m sure I should be able to sort this easily but for whatever reason I’m struggling atm. I need Score included in the results but having this in the GROUP BY inevitably returns more than just the record with the latest FormSubmitted date. Can anyone help me out in updating this query so I will get the Score in the results but only those records that are the maximum FormSubmitted date i.e exclude those marked *?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:35:45+00:00Added an answer on May 18, 2026 at 4:35 am
    SELECT     A.CNumber, A.FormSubmitted, A.Score
    FROM         dbo.vw_MSA A
    INNER JOIN 
    (SELECT CNumber, MAX(FormSubmitted) AS MaxSubmitted 
    FROM dbo.vw_MSA
    WHERE     (Score IS NOT NULL)
    GROUP BY CNumber) AS B
    ON A.CNumber = B.CNumber AND A.FormSubmitted = B.MaxSubmitted
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following SQL query: SELECT DISTINCT ProductNumber, PageNumber FROM table I am
I have the following SQL query: SELECT C.ID, C.Name FROM Category C JOIN Layout
Imagine I have the following SQL query: SELECT id,name FROM user WHERE id IN
I have the following SQL Query: SELECT porel.refcode, podetail.ponum, SUM(podetail.orderqty * podetail.unitcost) AS Total
I have the following SQL query SELECT tbl_product.prod_id, ISNULL (prod_code, '') AS prod_code, ISNULL
I have the following sql command, i need to escape parentheses in PostgreSQL, how
I'm using SQL server 2008 I have the following SQL getting all dates between
Well i have the following table(info from pgAdmin): CREATE TABLE comments_lemms ( comment_id integer,
I have difficulty understanding SELECT * FROM myTable WHERE 0 = ... in the
I'm building a repository layer for nhibernate, in which I have the following find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.