Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sort char field (contains dates) as date in a asp page

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-04-10 : 09:39:11
Theo writes "I have a field into an sql server that have dates with char format. I have to sort them into an asp page and the records are sorted like char. I want them to be viewed with date order."

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-10 : 09:43:42
Why did you use char datatype to store dates?
Use proper datatyep Datetime to avoid this difficulties

Try this

Order by cast(dateChar_col as datetime)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -