Sorting by year

Results 1 to 3 of 3

Thread: Sorting by year

  1. #1
    Join Date
    Dec 1969

    Default Sorting by year

    I have an Access DB and it works fine, but I want to sort my magazine collection by year. My Access DB has five fields (all are text) month, year, cover_image, quantity and condition.<BR><BR>Currently, I have them displayed, but it&#039;s all in one big block and I want to be able to have some navigation on top that will allow me to click on the year (i.e. 1992) and all the issues from that year will be displayed, preferably in order from January to December. I&#039;m not sure if I&#039;ll need to change the type of field in my month, it&#039;s not a problem if I need to. I just need the code that will allow me to do this.<BR><BR>Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default RE: Sorting by year

    SELECT *<BR>FROM yourTable<BR>WHERE Year = 2002<BR>ORDER BY Month DESC<BR><BR>Assuming your month is 1,2,3 and not January, Feb, March

  3. #3
    Join Date
    Dec 1969

    Default And next time

    use a proper data type to store a date.<BR><BR>If you don&#039;t care about the day of the month, just set them all to 01.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts