Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Ordering

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB
Hi

I have got a load of press releases in a database that i want to sort by date order (a date the user enters from three drop down and is then joined to form the dateformat below) the date is stored in the format mm/dd/yyyy, i am using this query:
Select * from tblPress WHERE Display=1 ORDER BY AddDate DESC

and getting results that are in no discernible order. can anyone help me to get the results to sort in the correct order ??
 
I'd say that the problem is that your dates are stored in text format. Sorting them in this format will not work (e.g. as strings 7/11/00 is greater than 6/11/01) If you change the format of your AddDate field so that the dates are stored in date format then your ORDER clause in the Select statement will work. Mise Le Meas,

Mighty :)
 
Or you could convert to seconds, makes it a load easier.

gsc1ugs
 
cheers guys that has sorted the problem, stupid of me really, it seemed to work with three entries in there, but failed when there were 40. thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top