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

  • Home
  • SEARCH
  • 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 711733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:46:07+00:00 2026-05-14T04:46:07+00:00

First of all, I’m still working in classic ASP (vbScript) with an MS Access

  • 0

First of all, I’m still working in classic ASP (vbScript) with an MS Access Database. And, yes I know its archaic, but I’m still hopeful I can do this!

So now to my problem:

Take the following table as an example:

PROJECTS

ContactName StartDate EndDate    Complete
Mitch    2009-02-13   2011-04-23   No
Eric    2006-10-01   2008-11-15   Yes
Mike    2007-05-04   2009-03-30   Yes
Kyle    2009-03-07   2012-07-08   No

Using ASP (with VBScript), and an MS Access Database as the backend, I’d like to be able to sort this table with the following logic:

I would like to sort this table by date, however, depending on whether a given project is complete or not I would like it to use either the “StartDate” or “EndDate” as the reference for a particular row.

So to break it down further, this is what I’m hoping to achieve:

For PROJECTS where Complete = “Yes”,
reference “EndDate” for the purpose of sorting.

For PROJECTS where Complete = “No”,
reference “StartDate” for the purpose of sorting.

So, if I were to sort the above table following these rules, the output would be:

PROJECTS

 ContactName StartDate EndDate   Complete
1 Eric    2006-10-01   2008-11-15*   Yes
2 Mitch    2009-02-13*   2011-04-23   No
3 Kyle    2009-03-07*   2012-07-08   No
4 Mike    2007-05-04   2009-03-30*   Yes

*I’ve put a star next to the date that should be used for the sort in the table above.

NOTE: This is actually a simplified version of what I really need to do, but I think that if I could just figure this out, I’ll be able to do the rest on my own.

ANY HELP IS GREATLY APPRECIATED; I’VE BEEN STRUGGLING WITH THIS FOR FAR TOO LONG NOW!

Thank you!

  • 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-14T04:46:08+00:00Added an answer on May 14, 2026 at 4:46 am
    select *
    from Projects
    order by iif(Complete = 'Yes', EndDate, StartDate)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, I know how to build a Java application. But I have
First of all: I am not an experienced ClearCase user, but I have lots
First of all there is a partial question regarding this, but it is not
First of all, I'm not looking for miracle... I know how PHP works and
First of all, I'm using KohanaPHP Framework. I've impletemented SWFUpload successfully, working quite nice.
First of all, I would like to state the facts I know about 'inline',
First of all, I don't need a textual comparison so Beyond Compare doesn't do
First of all, I'm fairly sure snapping to grid is fairly easy, however I've
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
First of all, let's define a few tables: Users table will store information about

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.