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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:08:26+00:00 2026-05-30T12:08:26+00:00

I wanted to see if it is possible to combine two strings and order

  • 0

I wanted to see if it is possible to combine two strings and order them by Date/Time?

dim strcountstf
dim strDateNTimes
dim strCOMBO
strcountstf = "02/01/2012 3:05am###,02/02/2012 7:05am###,02/05/2012 8:30pm###"
strDateNTimes = "02/01/2012 2:20am###,02/02/2012 8:00am###,02/06/2012 6:45pm###"

strCOMBO = strcountstf & strDateNTimes

Now strCOMBO will give me both of the strings together but I need them to be sorted by date/time, maybe using the CDate function?

Thanks again everyone I really appreciate all of the help that you give me.

  • 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-30T12:08:27+00:00Added an answer on May 30, 2026 at 12:08 pm

    Take a look at this quetion and using that, you can do something like this

    dim strcountstf
    dim strDateNTimes
    dim strCOMBO
    dim arrCOMBO
    dim strCOMBOSorted
    dim objSortedList
    dim i
    
    strcountstf = "02/01/2012 3:05am###,02/02/2012 7:05am###,02/05/2012 8:30pm###"
    strDateNTimes = "03/01/2011 2:20am###,02/02/2012 8:00am###,02/06/2012 6:45pm###"
    
    strCOMBO = strcountstf & "," & strDateNTimes
    
    arrCombo = Split(strCOMBO, ",")
    
    Set objSortedList = Server.CreateObject("System.Collections.SortedList")
    
    For i = LBound(arrCombo) To UBound(arrCombo)
        Call objSortedList.Add(CDate(Replace(arrCombo(i), "###", "")), arrCombo(i))
    Next
    
    strCOMBOSorted = ""
    
    For i = 0 To objSortedList.Count - 1
        strCOMBOSorted = strCOMBOSorted & ", " & objSortedList.GetByIndex(i)
    Next
    
    strCOMBOSorted = Right(strCOMBOSorted, Len(strCOMBOSorted) - 2)
    
    Set objSortedList = Nothing
    
    Response.Write("<br>")
    Response.Write(strCOMBO)
    Response.Write("<br>")
    Response.Write(strCOMBOSorted)
    

    Results:

    02/01/2012 3:05am###,02/02/2012 7:05am###,02/05/2012 8:30pm###,03/01/2011 2:20am###,02/02/2012 8:00am###,02/06/2012 6:45pm###
    03/01/2011 2:20am###, 02/01/2012 3:05am###, 02/02/2012 7:05am###, 02/02/2012 8:00am###, 02/05/2012 8:30pm###, 02/06/2012 6:45pm### 
    

    Please note that you have to make sure that the string can be parsed using CDate function and results in a valid date or do whatever you have to when calling Call objSortedList.Add(CDate(Replace(arrCombo(i), "###", "")), arrCombo(i)) i.e. the first argument (Key) must be a valid date, if you want to sort by date.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to see if it's possible to create interfaces, inherit them, and then
I'm messing around with Tamir.SharpSsh and wanted to see if it was possible to
I don't think it's possible from what I've read, but wanted to see if
I am using facebook registration plugin and wanted to see if its possible to
Before diving into Wordpress just wanted to see if it is possible to have
I wanted to see if it's possible to make a game similar to LOL
I'm a newcomer to clojure who wanted to see what all the fuss is
So I have a rather odd issue that I wanted to see if anyone
Before I go off and spend several hours building this, I wanted to see
I wanted to see if there is a way to tell the size, in

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.