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 521553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:15:44+00:00 2026-05-13T08:15:44+00:00

I am trying to correct the sort order of my ASP.NET drop down list.

  • 0

I am trying to correct the sort order of my ASP.NET drop down list.

The problem I have is that I need to select a distinct Serial number and have these numbers organised by DateTime Desc.

However I cannot ORDER BY DateTime if using DISTINCT without selecting the DateTime field in my query.

However if I select DateTime this selects every data value associated with a single Serial number and results in duplications.

The purpose of my page is to display data for ALL Serials, or data associated to one serial. When a new cycle begins (because it is a new production run) the Serial reverts to 1. So I cannot simply organise by serial number either.

When I use the following SQL statement the list box is in the order I require but after a period of time (usually a few hours) the order changes and appears to have no organised structure.

alt text http://img7.imageshack.us/i/captureky.jpg/

I’m fairly new to ASP.NET / SQL, does anyone know of a solution to my problem.

  • 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-13T08:15:44+00:00Added an answer on May 13, 2026 at 8:15 am

    If you have multiple date times for each serial number, then which do you want to use for ordering? If the most recent, try this:

    SELECT  SerialNumber,
            MAX(DateTimeField)
    FROM    Table
    GROUP BY SerialNumber
    ORDER BY 2 DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very simple problem...but weird results. Im just trying to fill a drop down list
I am trying to sort a bunch of objects that have sort order, however
I'm trying to correct the usual IE bugs around CSS 2.1 and need a
I am trying to correct a text that has some very typical scanning errors
I'm trying to work out the correct pattern to use for a Singleton that
I am trying to retrieve the correct value from an ArrayList of objects (.NET
I'm trying to find the correct event to listen for that will ensure that
I'm trying to sort a list of dates, but I'm struggling with null dates
I'm having a problem with a check_box_tag that I am using when trying to
I have a small problem that I think should be easily handled by SQL

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.