Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

About SQL Statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
March - 24 Apr 2008 21:44 GMT
Hello,

I want to get the <date> in the right order with using statement below:

"SELECT tDate FROM TempTB ORDER BY tDate;"

For example,

if  the list of records has

4/7/2008
4/8/2008
4/9/2008

From above statement, the first record I get is 4/7/2008, next 4/8/2008,
then 4/9/2008.

However, if the list has

4/7/2008
4/8/2008
4/9/2008
4/10/2008

From above statement, the first record I get is 4/10/2008. It' doesn't get
in the right order. This should get 4/7/2008 first.

In my table, I check the order of above list in the order.

Please give me suggestion.

Thank you so much

March
March - 24 Apr 2008 21:58 GMT
Thank you anyway. I could solve this problem :-).

I forgot to put "ASC" in the statement. <Ascending order>

"SELECT tDate FROM TempTB ORDER BY tDate ASC;"

March

> Hello,
>
[quoted text clipped - 30 lines]
>
> March
KARL DEWEY - 25 Apr 2008 00:02 GMT
ASC will not do it as it seems your dates are in a text field and not a
DateTime datatype.
Use this --
SELECT tDate FROM TempTB ORDER BY DateValue([tDate ]);

Signature

KARL DEWEY
Build a little - Test a little

> Thank you anyway. I could solve this problem :-).
>
[quoted text clipped - 38 lines]
> >
> > March
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.