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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Ordering

Status
Not open for further replies.

varnix

Programmer
Jan 7, 2002
94
US
I have a DB that is used to store some school related data, thngs are entered based on the semester and the year. These are separate fields within the database and we plan out outputting the data starting with the earliest year to the lastest.

Normally, this isn't a problem, but I can't guarantee that my data entry personnel will put the information in in order, so I need to order during the query.

If it were just the year I could do a order by yrinfo asc, but because I've got the semester coming into play as well I need the semester in a desc format while leaving the year in a asc format.

Unfortunately, I have none of my manuals at present to look this information up - what is the best way to format the order by statement to get things to come out as:
Spring 1998
Fall 1998
Spring 1999
Fall 1999

Etc...rather than Fall 1998, Spring 1998 and so on.

Thanks for the input!
 
order by yrinfo asc, semester desc

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top