Sorting a concatenate Date and time field

poul0035

Registered User.
Local time
Today, 08:17
Joined
Jul 1, 2009
Messages
10
I have a query that combines a date field and a time field together. When I try to sort that it seems to treat it as a text so that either Jan (1) will be at the top or Sep (9) will be at the top. Is there a way to sort this concatenate field based on earliest or latest?
 
I have a query that combines a date field and a time field together. When I try to sort that it seems to treat it as a text so that either Jan (1) will be at the top or Sep (9) will be at the top. Is there a way to sort this concatenate field based on earliest or latest?


Cast your string to a date using CDate()
 
That did it. Thanks.
 
You're welcome. I would also suggest you trim it as well before casting, like this:

CDate(Trim("concatenatedString"))
 

Users who are viewing this thread

Back
Top Bottom