Sort by Date

T

tim

I need to sort some records by year, month, day that I imported into a table
from a text file. The date field is in the following format: yyyymmdd

Any help is appreciated

Tim
 
R

RBear3

I believe you would just set it to sort by that field ascending or
descending. What is the problem you are having? Is it not sorting the way
you think it should?
 
G

Guest

If the field is in that format yyyymmdd it will sort it properly

Select * From TableName Order By Val([DateFieldName])

So when it converted into numbers it will be in the right order, probably
also if you left it as string


20060101
20060123
20070224
20070323
 
T

tim

It didn't look like it was sorting right by sorting the field in ascending
order the first time.

Thank you,
Tim
 
T

tim

Thank you, that worked.

Tim

Ofer Cohen said:
If the field is in that format yyyymmdd it will sort it properly

Select * From TableName Order By Val([DateFieldName])

So when it converted into numbers it will be in the right order, probably
also if you left it as string


20060101
20060123
20070224
20070323
--
Good Luck
BS"D


tim said:
I need to sort some records by year, month, day that I imported into a table
from a text file. The date field is in the following format: yyyymmdd

Any help is appreciated

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top