Results 1 to 3 of 3

Thread: Repeating region limited by date

  1. #1
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Repeating region limited by date

    I have an html table row set as a repeating region, showing data in date order over five years. It works very well, however, I don't really need the whole five years worth of data. I know there's a really simple way to limit the data retrieved from the database, but I'm a total noob at this.

    Edited to add: It has to be limited by date, rather than number of repeats, as there can be anywhere from 1 record to 50 in a year
    Last edited by marynorn; 01-10-2008 at 04:44 PM.

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    Sounds like this is more of a MySQL problem. It sounds like what you are looking for is something along the lines of
    Code:
    SELECT * FROM table WHERE date >= 2005 ORDER BY column DESC LIMIT startnumber, numberofrows
    In this case the column would be the date assuming that you have a date column in your database. You can also use asc instead of desc where asc = ascending order. After LIMIT you can use a single number to get say 13 results.

    Either way, play around with it and have fun

  3. #3
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks

    I kind of futzed about with it, and checked out some similar stuff I did before Christmas knocked off 15 IQ points and a good chunk of my memory, and the following seems to work:
    Code:
    FROM events WHERE eventDate > DATE_SUB(CURRENT_TIMESTAMP,INTERVAL 12 MONTH) ORDER BY eventDate ASC

Bookmarks

Posting Permissions

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